nesting routing in the official website, the original text says
const router = new VueRouter({
routes: [
{ path: "/user/:id", component: User,
children: [
{
// /user/:id/profile
// UserProfile User <router-view>
path: "profile",
component: UserProfile
},
{
// /user/:id/posts
// UserPosts User <router-view>
path: "posts",
component: UserPosts
}
]
}
]
})
I want to ask why it matches / user/:id/profile
rather than / user/profile
, because doesn"t / user/profile
look more like a child route under user? And what is the function of the middle layer? Thank you