Vue detects changes in data through Object.defineProperty, so it"s understandable that you can"t listen for array additions, because this detection binding operation has already been done for all properties in the constructor.
but the official text: due to the limitation of JavaScript, Vue cannot detect the following changing arrays:
when you set an item directly using the index, for example: vm.items [indexOfItem] = newValue
when you modify the length of the array, for example: vm.items.length = newLength
some people on the forum said that because the length of the array is variable, even if the length is 5, but there may not be index 4, I just want to ask where this answer comes from. The new element that modifies length, will be added to the last, its value is undefined, through the index can also get their value, how is it called "may not have index 4"?
now that you know why the length of the array can"t traverse all the elements and add all set and get through the index attribute, can"t you update the view at the same time?
if you have to say it, considering the performance problem, assuming that the element content has only four meaningful values, but the length is really 1000, it is impossible for us to detect 1000 elements. But the official said that due to JS restrictions, I would like to know what this restriction is? Thank you very much for helping me solve this problem.