[question]: how do multiple sibling components share a common component?
[description]: enter my website and correspond to different components according to the route (hereinafter referred to as component 1). Among these components, there is also a common part (hereinafter collectively referred to as component 2), but in the public part, some data in it, I need to transmit different data according to component 1. How can this be implemented?
[effect]:
for example, at the top of figure 1 above, I want to pass both the title and the text, in the button according to component 1.
[Business]: the user clicks on the user information in figure 2 on the home page and jumps to figure 2 (user details interface). Other modules are similar.
[Code]:
...
{ //2 router
path: "/user",
name: "User",
meta: { ... },
components: {
default: User,
footer: Footer
}
}, { //1 router
path: "/user/detail",
name: "UserDetail",
meta: { ... },
component: UserDetail
//components: {
//default: UserDetail,
//header: Header //2
//}
}
...
I want to use children in vue-router to implement it, but I find that I can"t do it.
I just entered the pit. How can I implement it? Give a train of thought is OK, the problem is a little rookie, do not like to spray, thank you!