Access Global Event Bus Outside Vue Files (v.0.15.1)
-
Is there any way to access global event bus outside Vue files on v0.15.1? The documentation only says on how to use it inside of Vue files but not outside. Thanks
-
Had this problem too.
I created my own global event bus using this tutorial: -
@Nicholas that’s also what I’m going to do if there is no way for now. Seems not possible I think. Would be great if there is a workaround.
-
It would be nice to get the Events component back in 0.15.1.
-
Yeah. I have resorted on creating my own Event Bus for the mean time.
-
Same here.
-
This might be of interest as well:
http://vuetips.com/global-event-bus -
This really depends where you are accessing the event bus. For example in a Vuex store you can pass the vue instance to the store when dispatching an action
-
@benoitranque Sounds good, could you maybe give some code example of this?
-
Never mind. You can access the vue instance with
this._vm
inside the store. Sothis._vm.$emit
should work