vue-geventbus
v1.0.2
Published
Global EventBus for Vue 2.0
Downloads
4
Maintainers
Readme
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 -S
Usage
- 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