S
S
siteweb2018-09-26 13:32:10
Vue.js
siteweb, 2018-09-26 13:32:10

Is the interaction between Vue components correct?

Am I doing it right?
If the user clicked the button in the popup, then I need to call the method (let's call it clear) in one of the components.
Now it works like this:
1. The shouldClearSomething = false property is created in the Vuex state
2. By the button in the popup, it changes to true
3. The component listens to this property through watch and if true, it calls the clear method and changes the value back to false.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vitaly Inchin ☢, 2018-09-26
@In4in

I did global events (using $emit, $on). Much more logical somehow.

A
Alex_Zdorgor, 2018-09-27
@Alex_Zdorgor

Event call is more suitable here. In fact, you wrote your crutch of the event =)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question