Skip to content

Instantly share code, notes, and snippets.

@arvidkahl
Created February 12, 2017 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arvidkahl/e9d9fb6a93dbf0b373f9d4f70fba7b79 to your computer and use it in GitHub Desktop.
Save arvidkahl/e9d9fb6a93dbf0b373f9d4f70fba7b79 to your computer and use it in GitHub Desktop.
eventbus-advanced-events.js
// Emit an Event from a Component using the internal Event Bus
let ComponentWithEventBus = Vue.extend({
mounted: function(){
this.$bus.$emit('status', 'Component mounted')
this.$bus.$on('something', ()=>{
console.log("Something happened");
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment