v-if/v-show状态值为数组某一项,改变不更新视图

条件判断
v-if=arr[index]当arr[index]改变的时候试图不会更新变化,这个时候需要做特殊处理(v-show同理)

vue官方提供方法

this.$set(this.vifValue,i,false)//vm.$set(arr,index,newValue)

死办法

 // this.vifValue[i] = false
// let arr = this.vifValue
 // this.vifValue = []
 // this.vifValue = arr

猜你喜欢

转载自blog.csdn.net/qq_40557812/article/details/97918255