A
A
Alex2019-11-04 15:58:30
Vue.js
Alex, 2019-11-04 15:58:30

What is the most correct way to implement communication between Vue components?

I am working on an application on Electron.
It has a component with a video inside. And separately there is a button component that opens a popup with application settings.
It is necessary in the video component to somehow track the opening / closing of the popup with settings and stop / resume video playback accordingly.
Components are not nested and are not adjacent.
Use some native JS events? Or a vuex module? Or how do Vue best practices advise tackling such tasks?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
guruloz, 2019-11-04
@Kozack

Vuex is just created in order to create connections between hierarchically unrelated components, or in the same hierarchy, but with a big difference in nesting levels. In short, in order not to fence crutches, you need to use either Vuex, or, more simply, EventBus

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question