Projetos
Ver no GitHub
JserWang/vue-event-proxy
Sobre
Let Vue.js support global events
Desenvolvimento web e de aplicativosCrescimento medido de estrelas
- em 24 h
- 0
- em 7 dias
- 0
- em 15 dias
- 0
- em 1 mês
- Coletando histórico
Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.
README.md
OriginalVue 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
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
Explore projetos relacionados
Carregando…