How I can do router with child
i-ked-ii opened this issue · 3 comments
i-ked-ii commented
I have more link in website. I want to know, how to use vue-extend-layout with router child
ktquez commented
Added support for child routes.
See example:
https://github.com/ktquez/vue-extend-layout/blob/master/example/src/pages/About/index.vue
https://github.com/ktquez/vue-extend-layout/blob/master/example/src/router.js
i-ked-ii commented
@ktquez
Are your sure this code can use?
I have problem.
[Vue warn]: Unknown custom element: <layout-default> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
My router
{
name: 'TournamentList',
path: '/tournament',
component: () => System.import('@/modules/tournament/views/List'),
meta: {
layout: 'layoutDefault'
},
children: [
{
name: 'List.Item',
path: '/clash',
component: () => System.import(/* webpackChunkName: "User" */ '@/modules/tournament/views/Item')
}
]
}
ktquez commented
src/layouts/default.vue
export default {
name: 'default' // Instead of layoutDefault
}
your router
{
name: 'TournamentList',
path: '/tournament',
component: () => System.import('@/modules/tournament/views/List'),
meta: {
layout: 'default' // optional, when it does not inform, the plugin takes the default layout
},
children: [
{
name: 'List.Item',
path: '/clash',
component: () => System.import(/* webpackChunkName: "User" */ '@/modules/tournament/views/Item')
}
]
}
E.g.
https://github.com/ktquez/vue-extend-layout#create-and-using-layouts