0๐
iโve already solved it ๐
the solution was create a new folder/file like this:
folder: eventHub/index.js
file contents:
import Vue from "vue";
const eventBus = new Vue()
export default eventBus
and then in the router file simple import and use
import eventHub from '@/eventHub'
eventHub.$emit('something');
pulled from the official docs:
vue docs events
- [Vuejs]-Vue3 array value problem between components
- [Vuejs]-Vue js error "Uncaught SyntaxError: import not found: default" when trying to import firebase
Source:stackexchange.com