vue subassembly when the component has not yet acquired the parent data, default values are displayed problems

Recently, when father and son pass the component values ​​shown vue found in the project, when my father did not spread to sub-component data not sub-assemblies, sub-assemblies will show the default value of the phenomenon at the moment, so the user experience is certainly not sex Ok. We have thought about before passing through the hook function in the past before rendering data subcomponents of a parent component. Asynchronous request but basically not easy to control the time, if you want to judge after rendering subassembly asynchronous request, so rendering back to delay component. Thinking back, I can first render subcomponents. But I do not show it out, so to solve this problem by v-if command.

 

 When the request interface returns the data, by determining whether there is data to the display control sub-assembly.

Guess you like

Origin www.cnblogs.com/danhua/p/12619764.html