Answer the question
In order to leave comments, you need to log in
How to load data after transition to another component?
The question is
There is a Component A and B.
In A there is an array which is shown on the page. When moving to B, this array is stored in store.
When I return to A, everything drawn from array disappears (because it is locally in component A).
That is, if I understand correctly, I need, when I return to A, I need to call a function and write data from the store to the local array.
Now the question is how to track such an event?
Update, beforeLoad, etc. didn't work in this case because I'm moving within the vue.
Have also tried this
beforeRouteLeave(to, from, next) {
console.log(to, from);
next();
},
Answer the question
In order to leave comments, you need to log in
> when I return to A, I need to call the function and write data from the store to the local array
Correctly understood, you can take data from the store in the mount
Something like this
mounted() {
FilesStore.dispatch('getFiles').then(() => {
this.vendors = FilesStore.getters.getBoards;
this.loader = false;
})
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question