vuevent

1.0.1 • Public • Published

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)
    })
  }
}

/vuevent/

    Package Sidebar

    Install

    npm i vuevent

    Weekly Downloads

    0

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    2.73 kB

    Total Files

    5

    Last publish

    Collaborators

    • hw0k