In vue, there are three components of A B C, which need A to jump from B to B to C, and then from C to B to B to A, and then to B without refreshing.

A jump to B needs to pass some parameters to B, B will request the interface according to the parameters, B to C also need to pass parameters, and then C requests the interface. Go back to BMageB to save the previous data, or if you want to cache BMageA, you"d better also cache it. What should I do? Should parameters be passed through url or something? router-link has a record to retreat, and this.$router.push () can also retreat

.

my idea is to use the keep-alive cache component, but there is a problem with eventBus for passing parameters. A to B $on will occur at the first time A to B is not loaded, there is no on at all, and there is no way to pass parameters

.
Mar.20,2021

you can try < keep-alive > to cache, or re-render the data in B when you go back to B


this requirement, I think it is relatively simple to use routing to implement

.
Menu