1.0.2 • Published 7 years ago
vue-geventbus v1.0.2
Vue Global EventBus
Introduction
Let Vue.js support global events
TypeScript support already (actually this plugin is written by TypeScript)
install
$ npm i vue-geventbus -S
# or
$ yarn add vue-geventbus -SUsage
- Install this Vue plugin
import VueEventBus from "vue-geventbus";
Vue.use(VueEventBus);- use Global Event function
just like
Vue.$on,Vue.$emit, but this plugin handle global event below is the table
| Vue Api | VueEventBus Api |
|---|---|
| $on | $gon |
| $once | $gonce |
| $emit | $gemit |
| $off | $goff |
More see: https://cn.vuejs.org/v2/api/#vm-on