0👍
You should use computed
properties in this case, it will be re-computed when data changed
computed: {
isActive () {
return (tab) => this.positionTab.activeTab === tab
}
}
If above code not work, you can separate to 2 computed properties
a.nav-link[data-toggle="tab" href="#answered" role="tab" :class="{ active: isActiveAnswer }"
a.nav-link[data-toggle="tab" href="#all" role="tab" :class="{ active: isActiveAll }"
and js
computed: {
isActiveAnswer () {
return this.positionTab.activeTab === 'answered'
},
isActiveAll () {
return this.positionTab.activeTab === 'all'
}
}
- [Vuejs]-BootstrapVue control columns number in form group
- [Vuejs]-How to write a function with data from different jsons?
Source:stackexchange.com