Can anyone help me with setting the active tab in my Vue tab component? I have it logging out the correct index of the selected tab, but I'm unsure how to actually show that tab as open. Any guidance would be greatly appreciated.
Component:
<Tabs
:tabs="tabs"
:active-tab-index="activeTab"
@tab-changed="changeTab"
/>
Markup
<div v-show="activeTab === 0">
Show tab one content
</div>
<div v-show="activeTab === 1">
Show tab two content
</div>
Data:
data() {
return {
tabs: [
{ id: 0, name: 'Tab One' },
{ id: 1, name: 'Tab Two' },
],
activeTab: 0,
}
},
Method:
changeTab(index) {
console.log('Change activeTab', index)
},