v-for 里面写 :class ='{active:flag[index]} @click="showContent(index)"
data:{
flag:[]
}
showContent:function(index){
var f=this.flag[index] = !this.flag[index]
this.$set(this.flag,index,f);
}
.active{
display: none;
}
vue for循环出来的数据变成折叠面板
最新推荐文章于 2023-05-29 00:46:32 发布