比如有三个按钮
button1.current button2.current button3.current
默认高亮button1,点击之后切换
在data写了个数组 [true, false, false]
click的method里传个index,@click="a(index)" button是循环出来的
用传入index来进行数组切换,this.array[index] = true
重新赋值后,dom没更新...
this.array[index] = true是无法被检查到,具体看数组更新检测
2.1m questions
2.1m answers
63 comments
56.7k users