1👍
For the second solution, you can use "@update:model-value" event on q-tab for detect current tab changing.
- [Vuejs]-Vue content/code not showing after importing
- [Vuejs]-Conditional classes on elements in Vue where we may have multiple options
0👍
Ok I have solved this by adding the click event on:
<q-route-tab
v-for="(tab, index) in tabs"
:key="index"
:to="tab.path"
:name="tab.name"
:label="$t(tab.label)"
:ripple="false"
exact
@click="onTabClick(tab)"
/>
and then emit the event in a method:
methods: {
onTabClick (tab) {
console.log("this is now called", tab.name)
this.$emit('onTabChange', tab.name)
}
}
Source:stackexchange.com