C
C
chelkaz2018-12-18 22:05:51
Vue.js
chelkaz, 2018-12-18 22:05:51

Is it possible to properly pass events, clicks and data from one new Vue instance to another new Vue?

Good afternoon. I have in one place of the page a component in it buttons, by clicking on which various records are made to the database through axios
But how, after a successful record, to transfer data to another component of another Vue instance?
const app_tree = new Vue (This is the first) in one place of the page
const app_essentidrop = new Vue (And this is at the other end of the page)
What is the easiest way and what methods are there for such a transfer and is it even possible?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2018-12-18
@chelkaz

There is an EventBus, you emit an event in one place, catch it in any other, while transmitting any data.
You can also use Vuex (data storage), you write the necessary data there, then you can also get them from this storage in any other component.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question