<button v-for="(tab,index) in item" @click="choose(index)" :class="[isActive?classA:classB]">
{{tab.con}}
</button>
data () {
return {
item:[
{con:""},
{con:""},
{con:""},
{con:""}
],
classA:"classA",
classB:"classB",
isActive:false
}
},
methods:{
choose(index){
this.isActive=!this.isActive ;
}
}
want to highlight both single and multiple selections, and click to cancel the highlight again. Now is it all highlighted by clicking on the whole? How to solve? Do you want the for loop to judge each tag?