|
14 | 14 | direction="vertical" |
15 | 15 | > |
16 | 16 | <v-tab |
17 | | - v-for="(_, index) in visibleCategories" |
18 | | - :key="`${layout.path}-${visibleCategories.length}-${index}`" |
| 17 | + v-for="entry in visibleCategoriesWithIndex" |
| 18 | + :key="`${layout.path}-${entry.originalIndex}`" |
19 | 19 | > |
20 | | - {{ visibleCategoryLabels[index] }} |
| 20 | + {{ entry.category.value.label }} |
21 | 21 | </v-tab> |
22 | 22 | </v-tabs> |
23 | 23 | </v-col> |
|
28 | 28 | v-bind="vuetifyProps('v-window')" |
29 | 29 | > |
30 | 30 | <v-window-item |
31 | | - v-for="(element, index) in visibleCategories" |
32 | | - :key="`${layout.path}-${visibleCategories.length}-${index}`" |
| 31 | + v-for="entry in visibleCategoriesWithIndex" |
| 32 | + :key="`${layout.path}-${entry.originalIndex}`" |
33 | 33 | > |
34 | 34 | <dispatch-renderer |
35 | 35 | :schema="layout.schema" |
36 | | - :uischema="element.value.uischema" |
| 36 | + :uischema="entry.category.value.uischema" |
37 | 37 | :path="layout.path" |
38 | 38 | :enabled="layout.enabled" |
39 | 39 | :renderers="layout.renderers" |
|
46 | 46 | <v-row v-else v-bind="vuetifyProps('v-row')"> |
47 | 47 | <v-tabs v-model="activeCategory" v-bind="vuetifyProps('v-tabs')"> |
48 | 48 | <v-tab |
49 | | - v-for="(_, index) in visibleCategories" |
50 | | - :key="`${layout.path}-${visibleCategories.length}-${index}`" |
| 49 | + v-for="entry in visibleCategoriesWithIndex" |
| 50 | + :key="`${layout.path}-${entry.originalIndex}`" |
51 | 51 | > |
52 | | - {{ visibleCategoryLabels[index] }} |
| 52 | + {{ entry.category.value.label }} |
53 | 53 | </v-tab> |
54 | 54 | </v-tabs> |
55 | 55 |
|
56 | 56 | <v-window v-model="activeCategory" v-bind="vuetifyProps('v-window')"> |
57 | 57 | <v-window-item |
58 | | - v-for="(element, index) in visibleCategories" |
59 | | - :key="`${layout.path}-${visibleCategories.length}-${index}`" |
| 58 | + v-for="entry in visibleCategoriesWithIndex" |
| 59 | + :key="`${layout.path}-${entry.originalIndex}`" |
60 | 60 | > |
61 | 61 | <dispatch-renderer |
62 | 62 | :schema="layout.schema" |
63 | | - :uischema="element.value.uischema" |
| 63 | + :uischema="entry.category.value.uischema" |
64 | 64 | :path="layout.path" |
65 | 65 | :enabled="layout.enabled" |
66 | 66 | :renderers="layout.renderers" |
@@ -115,13 +115,13 @@ const layoutRenderer = defineComponent({ |
115 | 115 | }; |
116 | 116 | }, |
117 | 117 | computed: { |
118 | | - visibleCategories() { |
119 | | - return this.categories.filter((category) => category.value.visible); |
120 | | - }, |
121 | | - visibleCategoryLabels(): string[] { |
122 | | - return this.visibleCategories.map((element) => { |
123 | | - return element.value.label; |
124 | | - }); |
| 118 | + visibleCategoriesWithIndex() { |
| 119 | + return this.categories |
| 120 | + .map((category, originalIndex) => ({ |
| 121 | + category, |
| 122 | + originalIndex, |
| 123 | + })) |
| 124 | + .filter((e) => e.category.value.visible); |
125 | 125 | }, |
126 | 126 | }, |
127 | 127 | }); |
|
0 commit comments