v-hub

v1.0.0
A vue plugin working as event bus.

v-hub

A vue plugin working as event bus.

Install

yarn add v-hub

# or
npm install --save v-hub

Import

// import
import vHub from 'v-hub';
Vue.use(vHub);

// use
created() {
  this.$hub.on('EVENT_NAME', () => {
    // ...
  });
},
destroy() {
  this.$hub.off();
}

API

  • .on
  • .once
  • .emit
  • .off
npm i v-hub

Metadata

  • MIT
  • Whatever
  • wemlion
  • released 4/14/2017

Downloads

Maintainers