import homePage from '@/views/home/home.vue' const children = [ { path: 'dashboard', name: 'dashboard', meta: { title: '概览', permission: 1 }, component: () => import('@/views/dashboard/dashboard.vue') }, { path: 'content', name: 'content', meta: { title: '内容管理', permission: 2 }, component: () => import('@/views/content/content.vue') }, { path: 'category', name: 'category', meta: { title: '分类管理', permission: 3 }, component: () => import('@/views/category/category.vue') }, { path: 'user', name: 'user', meta: { title: '用户管理', permission: 4 }, component: () => import('@/views/user/user.vue') }, { path: 'settings', name: 'settings', meta: { title: '系统设置', permission: 5 }, component: () => import('@/views/settings/settings.vue') } ] const authRoute = [ { path: '/', name: 'home', meta: { title: '首页', permission: 1 }, component: homePage, redirect: '/dashboard', children: [...children] } ] const menuList = children.map((item) => { return { label: item.meta.title || '', path: '/' + item.path, key: item.name, permission: item.meta.permission || 0 } }) export { authRoute, menuList }