1. The data is successfully received in vue, but the page rendering fails. code show as below
After searching the data, modify the code to
or
The reason is:
Due to JavaScript limitations, Vue cannot detect the following changing arrays:
- When you use the index to set an item directly, for example:
vm.items[indexOfItem] = newValue
- When you modify the length of the array, for example:
vm.items.length = newLength
But the array can be manipulated by set and push, splice