I have two routes, say posts & pages, inside each user route, like
/user/foo/pages, user/foo/posts, /user/bar/pages, user/bar/posts
where foo and bar are the dynamic content. However nested routing in vue does not including those foo and bar
router.js
export default new Router({
routes: [
{
path: '/user/:id',
name: 'user',
component: User,
children: [
{path: 'posts', name: 'posts', component: Posts},
{path: 'pages', name: 'pages', component: Pages},
]
}
]
})
User.vue
<router-link to="posts">Posts</router-link>
<router-link to="pages">Pages</router-link>
The result vue is producing when i am already inside foo or bar, is
<a href="#/user/posts">Posts</a>
<a href="#/user/posts">Pages</a>
However the expected result should be (when i am inside foo)
<a href="#/user/foo/posts">Posts</a>
<a href="#/user/foo/pages">Pages</a>