1.0.1 • Published 7 years ago

vuevent v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

vuevent

A Vue.js Plugin which helps to use EventBus easily.

Installation

CommonJS:

$ npm i --save vuevent

And in your entry file:

import Vue from 'vue'
import Vuevent from 'vuevent'

Vue.use(Vuevent)

Usage:

This plugin binds a New Vue instance as a Global EventBus.

You can use like this:

// Sender Component
export default {
  methods: {
    this.$vuevent.$emit('event', 'hello world!')
  }
}

// Receiver Component
export default {
  mounted() {
    this.$vuevent.$on('event', args => {
      alert(args)
    })
  }
}
1.0.1

7 years ago

1.0.0

7 years ago