The sibling component cannot transmit information after the vue-router route is redirected

I use vue-router to do two routes, one is the home page, the other page, and then use header to switch routes and do sibling component communication, but found that header can only trigger the home page listeners, when switching routes can not trigger other page listeners, I do not know why? Can only be solved with vuex?

Mar.03,2021

it is estimated that the trigger time is not right. At the time of trigger, the component has not yet been listened to by created,.
you can take a look at the vue data transfer


paste the code, otherwise you can only guess


do it yourself with the routing parameters.

Menu