vue-global-bus
v1.0.6
Published
The simple global event bus for vuejs v2
Downloads
2
Maintainers
Readme
VueJS Eventbus Plugin
Introduction
A simple global event-bus plugin for VueJS (>= 2.0).
This plugin implements Non Parent-Child Communication.
Install
$ npm i vue-global-bus -S
Download and use with your build system
import VueBus from 'vue-global-bus'
// or
const VueBus = require('vue-global-bus')
Vue.use(VueBus)
Usage
// in component A's method
this.$bus.$emit('my-event', payload)
// in component B's created hook
this.$bus.$on('my-event', (payload) => {
// ...
})