[Vuejs]-Bootstrap Tab with VueJS 1.0.28 not working properly while working with Vue 1.0.18

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'
  }
}

Leave a comment