Home > Web Front-end > JS Tutorial > body text

Detailed explanation of how vuejs dynamic components pass data to subcomponents

高洛峰
Release: 2017-01-12 13:33:29
Original
1653 people have browsed it

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 dynamic component, this When there is no explicit sub-component tag, to pass data to the sub-component you need to bind it in

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

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!

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!