ktquez/vue-extend-layout

How I can do router with child

i-ked-ii opened this issue · 3 comments

I have more link in website. I want to know, how to use vue-extend-layout with router child

@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')
            }
        ]
}

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