44

你应该要知道的Vue.js

 6 years ago
source link: https://juejin.im/post/5ab2ff496fb9a028c06ab78f
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.
原文:你应该要知道的Vue.js 组件data为什么必须是函数? 因为组件可能被多处使用,但他们的data是私有的,所以每个组件都要return一个新的data对象 组件通信 父子组件通信:$on、$emit 非父子组件的通信: event bus 复杂情况

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK