Vue data update view does not refresh solution

Solution 1 : this.$set()

this.$set(要操作的对象或数组, 要新增或者修改的数组或对象key, 对应的值)

Solution 2 : Force refresh the page

this.$forceUpdate()

Solution 3: Object.assign (use the feature of modifying the stack to trigger view updates)

Object.assign can copy and synthesize a new object, so we only need to merge the values ​​to be modified into a new object and assign it to the object or array in data. In this way, the stack pointer is modified and the view update is triggered.

Guess you like

Origin blog.csdn.net/m0_61672533/article/details/130553131