I'm trying to set up a vue event bus to send events between my components, I have this within my app.js
file Vue.prototype.$eventBus = new Vue();
then in one component I have this
this.$eventBus.$emit('pnc-person', remarkString);
and in a different component, within the mounted method I have this,
this.$eventBus.$on('pnc-person', (data) => {
console.log(data);
});
The event is emitted successfully, and I can see that in the vue dev tools, but it is not caught by the second component, I am using vue router so I'm not sure if that would affect it.
I have tried using both this.$route.$on
and this.$eventBus.$on
but neither seem to log anything