Created
February 12, 2017 08:18
-
-
Save arvidkahl/e9d9fb6a93dbf0b373f9d4f70fba7b79 to your computer and use it in GitHub Desktop.
eventbus-advanced-events.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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