vue for循环出来的数据变成折叠面板

mac2024-06-20  53

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; }
最新回复(0)