The data is received successfully in vue, but the page rendering fails

 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:

  1. When you use the index to set an item directly, for example: vm.items[indexOfItem] = newValue
  2. 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

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324911968&siteId=291194637