Skip to content

v-comp/v-hub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published