Home  >  Article  >  Web Front-end  >  Detailed explanation of how vuejs dynamic components pass data to subcomponents

Detailed explanation of how vuejs dynamic components pass data to subcomponents

高洛峰
高洛峰Original
2017-01-12 13:33:291647browse

The props used when defining sub-components can support parent components to pass data to sub-components. These defined props can be bound to the tags of sub-components, but if you are using a 8c05085041e56efcb85463966dd1cb7e dynamic component, this When there is no explicit sub-component tag, to pass data to the sub-component you need to bind it in 8c05085041e56efcb85463966dd1cb7e

<div class="app" id="deviceready">
<component :is="currentView" :user_name.sync="user_name" :DOB.sync="DOB"></component>
</div>

The role of the component is independent

The function of the component is independent. If you want to get data from the component, you need to pass it layer by layer. That is to say, the child component can only get the data from the direct parent component. If it is the data of the root component, Then the parent component will continue to expose pops to bind data from the root component.

The above is a detailed explanation of the method of passing data from vuejs dynamic components to sub-components introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message. Editor Will reply to everyone promptly. I would also like to thank you all for your support of the PHP Chinese website!

For more detailed explanations of how vuejs dynamic components pass data to subcomponents, please pay attention to the PHP Chinese website for related articles!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn