D
D
Darkness2019-07-12 12:04:47
Vue.js
Darkness, 2019-07-12 12:04:47

What is wrong with my event.bus in vue?

Main.js

Vue.config.productionTip = false;
   export const EventBus = new Vue();

1st component
import { EventBus  } from '../../../main';

 EventBus.$emit("emmitTest", this.showChoose); // передаю true

2nd component
import { EventBus  } from '../../../main';

created() {
       EventBus.$on('emmitTest', data => {
            this.showChoose = data; .// это должно изменить в data showChoose на true из другого компонента,
        });
    },

But the value is not written, there is no error, nothing. It just doesn't work, where is the mistake?
In the Parent of these components, I do nothing, I will be grateful for the help!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question