54

说说在 Vue.js 中如何实现组件间通信(高级篇)

 5 years ago
source link: https://juejin.im/post/5c0cd21e6fb9a049e307ec96
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
之前说过,可以使用 props 将数据从父组件传递给子组件。其实还有其它种的通信方式,下面我们一一娓娓道来。 1 自定义事件 通过自定义事件,我们可以把数据从子组件传输回父组件。子组件通过 $emit() 来触发事件,而父组件通过 $on() 来监听事件,这是

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK