0
votes

I am currently trying to make the active tab change when I put a value in a variable which controls the component, but it doesn't work. I am binding a variable to v-model and then changing that variable with the value I want. The point is, wheter the value is a number or a string, it doesn't matter because the tabs won't work.

<v-card flat>
        <v-tabs v-model="tab" fixed-tabs>
            <v-tab v-for="(instance, idx) in tabData" :key="`${idx}`" @click="callChildrenToUpdate(idx)">
            <v-badge color="red" size="18" class="p-2" v-if="instance"></v-badge>
            ...
            </v-tab>
        </v-tabs>
       ...
</v-card>
        

The data:

data () {
        return {
            tab: null,
            items: [],
            tabData: this.tabsData
        }
    },

And then in the mounted hook I try changing it, but it won't work.

this.tab = 87 
Change tabs via the UI, and see if tab value changes using Vue Dev ToolsNizar Zizoune
Yeah it changes but the tab value when it happens is like: 0, 1, 2... can't it be the key I gave them? It is so weird.mrssolaris
This works for me using the sandbox provided by Vuetify: codepen.io/mrichar1/pen/VwMMeqzmatch
@mrssolaris no tab will go from first to last following 0, 1, 2... respectively.Nizar Zizoune