Vue renders an error before asynchronously loading data

Original solution

https://blog.csdn.net/edc3001/article/details/86833558

 

An error that data cannot be obtained was encountered during development

 

  But the reality is normal

 

It is considered here that Vue has rendered before asynchronously loading data, and an error will be reported if the data is not obtained. The later implementation is normal because the two-way binding data has obtained automatic rendering

Vue initially defines the data and displays the acquired data in the

 

Solution: add V-IF in the main div of the component to judge that the object value is not empty before rendering

 

Similar Posts: