Vue value transfer problem

recently learned vue, to practice passing values between components.
this.$router.push ({name: "detail", params: {userInfo: thisName}})
accept: this.msg = this.$route.params.userInfo;
but why does this value become undefined, after the page refreshes?

Mar.05,2021

should be this.$route.params.params.userInfo, and this is not a value transfer between components.


it seems that this is not a value transfer, right?


where does the routing value come from when the refresh page overloads?
this question can be figured out in a moment

.

routing value

paramsquery
queryget
paramspost  query url,
,

change params to query

pass a value: this.$router.push ({name: 'detail', query: {userInfo: thisName}})
accept: this.msg = this.$route.query.userInfo;


your method is to route jump transfer parameters
and then route to configure
is there any /: userInfo

after your routing address?
Menu