Skip to content

Commit ed793f9

Browse files
committed
apply the same fix for the visible categories
1 parent ccc9ffe commit ed793f9

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

packages/vue-vuetify/src/layouts/CategorizationRenderer.vue

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
direction="vertical"
1515
>
1616
<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}`"
1919
>
20-
{{ visibleCategoryLabels[index] }}
20+
{{ entry.category.value.label }}
2121
</v-tab>
2222
</v-tabs>
2323
</v-col>
@@ -28,12 +28,12 @@
2828
v-bind="vuetifyProps('v-window')"
2929
>
3030
<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}`"
3333
>
3434
<dispatch-renderer
3535
:schema="layout.schema"
36-
:uischema="element.value.uischema"
36+
:uischema="entry.category.value.uischema"
3737
:path="layout.path"
3838
:enabled="layout.enabled"
3939
:renderers="layout.renderers"
@@ -46,21 +46,21 @@
4646
<v-row v-else v-bind="vuetifyProps('v-row')">
4747
<v-tabs v-model="activeCategory" v-bind="vuetifyProps('v-tabs')">
4848
<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}`"
5151
>
52-
{{ visibleCategoryLabels[index] }}
52+
{{ entry.category.value.label }}
5353
</v-tab>
5454
</v-tabs>
5555

5656
<v-window v-model="activeCategory" v-bind="vuetifyProps('v-window')">
5757
<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}`"
6060
>
6161
<dispatch-renderer
6262
:schema="layout.schema"
63-
:uischema="element.value.uischema"
63+
:uischema="entry.category.value.uischema"
6464
:path="layout.path"
6565
:enabled="layout.enabled"
6666
:renderers="layout.renderers"
@@ -115,13 +115,13 @@ const layoutRenderer = defineComponent({
115115
};
116116
},
117117
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);
125125
},
126126
},
127127
});

0 commit comments

Comments
 (0)