[英]How to pass data from the component to the main app in vue?
I'm just curious about how to pass the data from the component to the main app.我只是好奇如何将数据从组件传递到主应用程序。 like, we pass the props to the component.
比如,我们将 props 传递给组件。
Props can be only send to child components.道具只能发送到子组件。
If you want to send data from child component to parent.如果要将数据从子组件发送到父组件。 It can be achieved by emit .
它可以通过发射来实现。
Read this article.阅读这篇文章。 You can understand it clearly.
你可以清楚地了解它。
https://www.geeksforgeeks.org/communication-between-components-using-emit-and-props-in-vue-js/ https://www.geeksforgeeks.org/communication-between-components-using-emit-and-props-in-vue-js/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.