You can pass the name
in the query
when switching routes as follows:
<router-link
:to="{ path: '/user/details', query: { name: user.name } }"
>
User Details
</router-link>
And then parse it in the details
component as follows:
data: () => ({ userName: "" }),
created() {
this.userName = this.$route.query.name;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…