1
0
mirror of https://github.com/zclzone/vue-naive-admin.git synced 2025-12-28 12:10:20 +08:00

refactor: refactor async routes

This commit is contained in:
张传龙
2022-08-07 22:25:28 +08:00
parent 869a68812c
commit ef3aaa5be5
10 changed files with 159 additions and 182 deletions

View File

@@ -0,0 +1,50 @@
const Layout = () => import('@/layout/index.vue')
export default {
name: 'Example',
path: '/example',
component: Layout,
redirect: '/example/table',
meta: {
title: '组件示例',
icon: 'mdi:menu',
role: ['admin'],
requireAuth: true,
},
children: [
{
name: 'Table',
path: 'table',
component: () => import('./index.vue'),
redirect: '/example/table/post',
meta: {
title: '表格',
icon: 'mdi:table',
role: ['admin'],
requireAuth: true,
},
children: [
{
name: 'PostList',
path: 'post',
component: () => import('./post/index.vue'),
meta: {
title: '文章列表',
role: ['admin'],
requireAuth: true,
},
},
{
name: 'PostCreate',
path: 'post-create',
component: () => import('./post/PostCreate.vue'),
meta: {
title: '创建文章',
role: ['admin'],
requireAuth: true,
},
},
],
},
],
}