I want to passing the data to another component by using the eventbus. In main.js, I set the event bus and everything works properly, except for the code below. when I emit the data COMPONENT 1 (component which emit data)
emitovanje () {
EventBus.$emit("UnverifiedCars", this.numberOfunverifiedCars)
}
and now in the second component I do
COMPONENT 2 (component which recieve data)
created () {
EventBus.$on("UnverifiedCars", numberOfunverifiedCars => {
console.log(numberOfunverifiedCars)
//this code return me data in Component 1
})
}