The speed of data requested by vuex asynchronously is slower than that of page rendering.

  1. the page has been rendered after calling the method in actions to get the data asynchronously. And reported an error.

clipboard.png

clipboard.png

clipboard.png

clipboard.png

clipboard.png

clipboard.png

clipboard.png

Mar.18,2021

isn't it normal that data from asynchronous requests is slower than page rendering? Your mistake here is that the compatibility of the code is not good enough. When reading the properties of an object (object,array,function, etc.), you need to judge whether the data type of the object is correct


you can use v-if to hide the banner first, and then display the data after the request, so that there will be no problem.


add a judgment to banner [0] .data.baked to determine whether it exists or not.


you are not recommended to write this way, you can write vshow = "banner", and then assign a value to banner after getting the data. In short, try not to use unknown data.

Menu