-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Closed
Labels
Description
It could be interesting to have a parent route definition without any component and having the matched children rendered in the root <router-view>
. Here is an example:
var routes = [
{
path: '/:lang',
children: [
{
path: '',
component: WelcomeComponent
},
{
path: 'hello/:name',
component: HelloComponent
}
]
}
]
This won't work. Instead, this is what I am doing:
var routes = [
{
path: '/:lang',
// create a container component
component: {
render (c) { return c('router-view') }
},
children: [
{
path: '',
component: WelcomeComponent
},
{
path: 'hello/:name',
component: HelloComponent
}
]
}
]
But the original problem was to scope my routes by their definitions only, not by components.
francoislevesque, jeffjose, kent8818, crosh, ForsakenHarmony and 57 more