Solve the problem that the Vue parent component asynchronously obtains dynamic data and passes it to the child component, and the child component cannot get the value

For example, when an editor.vue subcomponent is introduced into a parent component, it is necessary to pass an acquired data (for example, the variable name is defined as htmlcontent) to the editor.vue subcomponent after requesting the backend interface. Null values ​​are often passed. Because the child component has rendered the data of the parent component and has not yet obtained it, you can use v-if to set a variable at this time, and then use this variable to render the child component after obtaining the data.

 

 

 

Guess you like

Origin blog.csdn.net/spring_007_999/article/details/128162127