vue
在vue中数组的元素并不是响应式的,有时会出现数据改变而页面不响应的问题。
这里通过this.$set来让数组的元素变为响应式数据
例如我为对象数组noteList的每一个对象添加了一个为disabled的属性,并且让他变为响应式的数据,初始值为true
this.listTask.forEach(function(item,index){ if(item.groupName == groupName) { app.$set(item,"status","INIT"); } });