edvoyui-component-library-test-flight 0.0.65 → 0.0.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
</template>
|
|
77
77
|
|
|
78
78
|
<script setup lang="ts">
|
|
79
|
-
import { onMounted, PropType, ref } from "vue";
|
|
79
|
+
import { onMounted, PropType, ref, watch } from "vue";
|
|
80
80
|
|
|
81
81
|
const props = defineProps({
|
|
82
82
|
datas: {
|
|
@@ -104,6 +104,20 @@ const props = defineProps({
|
|
|
104
104
|
|
|
105
105
|
const openAccordions = ref<boolean[]>(Array(props.datas.length).fill(false));
|
|
106
106
|
|
|
107
|
+
const initializeOpenAccordions = () => {
|
|
108
|
+
openAccordions.value = props.datas.map((_, index) =>
|
|
109
|
+
props.defaultOpen.includes(index)
|
|
110
|
+
);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
watch(
|
|
114
|
+
() => props.defaultOpen,
|
|
115
|
+
() => {
|
|
116
|
+
initializeOpenAccordions();
|
|
117
|
+
},
|
|
118
|
+
{ immediate: true }
|
|
119
|
+
);
|
|
120
|
+
|
|
107
121
|
onMounted(() => {
|
|
108
122
|
props.defaultOpen.forEach((index: number) => {
|
|
109
123
|
if (index >= 0 && index < openAccordions.value.length) {
|