1.0.6 • Published 6 years ago

vue-global-bus v1.0.6

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

VueJS Eventbus Plugin

awesome-vue

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) => {
  // ...
})

License

MIT