There are several methods that can trigger a view update:
Push (), pop(), Shift (), unshift(), splice(), sort(), reverse() all change the array being manipulated; The filter(), concat(), and slice() methods do not alter the array being operated on, but return a new array; All of the above methods can trigger view updates.Copy the code
There are several ways to not trigger a view update:
Array [index] = newValue Changes the length of the array. For example, this.array.length = newLength.Copy the code
There are two ways to resolve the problem of not triggering view updates:
Solution 1: you can use this. $set (this array, index, newValue) or enclosing array. The splice (index, 1, newValue) solution 2: You can use this. Array. Splice (newLength)Copy the code