Array responsiveness in Vue2, how to implement responsiveness through index?

written in front

this.arr[0]='adda';//It cannot be displayed on the page responsively

Modify array elements by index value, not a responsive method

Array Responsiveness

1.push() Add data at the end of the array 

2.splice() implements insertion and deletion of elements

3.pop() deletes the last element

4.shift() deletes the first element of the array

5.unshift() add elements in front of the array

6.sort() sorts the array

7.reverse() reverses the array

Responsive modification through the set method

Vue.set(this.data.arr,0,'adda')

Guess you like

Origin blog.csdn.net/qq_42533666/article/details/129199218