1.0.5 • Published 6 years ago

vue-event-proxy v1.0.5

Weekly downloads
33
License
ISC
Repository
github
Last release
6 years ago

Vue Event Proxy

npm npm.io npm.io

Introduction

The Library that let Vue.js support global events, just 1.79kb after compression.

  1. Global events are implemented by adding a prefix
  2. 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

import EventProxy from 'vue-event-proxy';
Vue.use(EventProxy);

this.$on('global:EVENT_NAME');
this.$once('global:EVENT_NAME');
this.$emit('global:EVENT_NAME');

More see: https://cn.vuejs.org/v2/api/#vm-on

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago