Vue Event Proxy
Introduction
The Library that let Vue.js support global events, just 1.79kb after compression.
- Global events are implemented by adding a prefix
- Registered event will be removed when component is destroyed
Demo: CodeSandbox
install
$ npm install --save vue-event-proxy
Usage
Just add global:
prefix to first argument of methods: $on
, $emit
, $once
;Vue; this;this;this;
More see: https://cn.vuejs.org/v2/api/#vm-on