【备忘录】使用eventHub非父子组件通信,报TypeError: cbs[i].apply is not a function

Vue.prototype.$eventHub = new Vue();
 
this.$eventHub.$emit('update:someValue', this.myValue);
this.$eventHub.$on('update:someValue', arg => this.wrapperValue = arg);
 
参考:https://stackoverflow.com/questions/41916838/issue-with-emitting-events-in-vue-with-eventhub
posted @ 2018-04-23 14:51  xiaoroad  阅读(280)  评论(0编辑  收藏  举报