How does vue fail to get the value of $on snooping through props when routing is switched?

component A:
loginContent, is triggered to pass response.data after a successful login interface request

clipboard.png

BA:
loginContent

clipboard.png

Aresponse.data

Bresponse.data

clipboard.png

what is the problem?

Mar.07,2021

because you routed the switch to component B, the data in component B will be reinitialized initialized .
if your An and B components are rendered in the same route, the above processing is fine.
you are not on the same route. You can use Vuex for data processing
https://vuex.vuejs.org/zh-cn/.

.
Menu