javascript - Vue2 new array overwrites old array problem
我想大声告诉你
我想大声告诉你 2017-05-19 10:22:42
0
2
467

For example, old = [1,3,4,5]; new = [212,43,54,23];
Use new to overwrite old, Vue can detect changes in the array and re-render the data

我想大声告诉你
我想大声告诉你

reply all(2)
左手右手慢动作

Vue has a section dedicated to this

PHPzhong

Yes, as long as old is responsive, replacing it with new will trigger set, and Vue can make new and the elements inside responsive.

Like old[233] = 1 because old[233] is originally undefined and Vue cannot detect it without binding get and set.

For more information, please see the documentation
https://cn.vuejs.org/v2/guide...
https://cn.vuejs.org/v2/guide...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template