1.使用$set()
(1).直接使用:
this.$set(this.data[index], 'type', true);
(2).如果不生效,先需要先将原来的属性删除,然后再进行更新:
this.$delete(this.data[index], 'type',)
this.$set(this.data[index], 'type', true);
2.使用splice–主要针对数组
let item = this.data[index]
item.type= true
this.data.splice(index,1,item)