Infinity
Infinity

Reputation: 3

Vue js, how to get callback from emit

So Im made an $emit to an event bus in other conponent, where the component run a function 'save' from $on.

Is there a way to send a callback to emit showing that the 'save' function is made succesfully?

Im a bit new to vue. Thanx for all help

Upvotes: 0

Views: 1987

Answers (1)

fh0592x
fh0592x

Reputation: 286

You may need to emit a second event using the EventBus to show that the save function was successful. Or, as @samayo mentioned, you could use state (Vuex). Read more about managing state with Vuex here.

Upvotes: 1

Related Questions