<text v-for="(item,index) in reasonList" :key="index" class="reason radius margin-bottom-sm "
:class="isCheck[index].name ==true ? 'reasonChecked' : 'reasonunChecked'"
@click="change(index)">{{item.name}}</text>
change(index) {
this.isCheck[index].name= !this.isCheck[index].name;
this.$forceUpdate();
},
重点在于 this.$forceUpdate(); 强制更新data
如果没有这一步 虽然在控制台能打印出来 但是页面并不会渲染