1. 設置對象或數組的值:Vue.set(target,key,value) ;
2.刪除對象或數組中元素: Vue.delete ( target,key) ;
3. 數組對象直接修改屬性,可以觸發視圖更新:
this.array[0].show = true;
4.splice方法修改數組,可以觸發視圖更新:
this.array.splice(indexOfItem, 1, newElement)
5.數組整體修改,可以觸發視圖更新:
var tempArray = this.array;
tempArray[0].show = true;
this.array = tempArray;
6.用Object.assign或lodash.assign可以為對象添加響應式屬性,
可以觸發視圖更新:
7.Vue提供了如下的數組的變異方法,可以觸發視圖更新:
push()/pop()/shift()/unshift()/splice() /sort()/reverse()