/** When your routing table is too long, you can split it into small modules**/ import Layout from '@/layout' const prodRouter = { path: '/prods', component: Layout, redirect: '/prod/page', alwaysShow: true, // will always show the root menu name: 'Prod', meta: { title: 'prods', // 会自动被i18n替换 icon: 'star', roles: ['admin', 'assistant', 'runner', 'shoper'] // you can set roles in root nav }, children: [{ path: 'page', component: () => import('@/views/permission/page'), name: 'ProdList', meta: { title: 'ProdList', roles: ['admin', 'assistant', 'runner', 'shoper'] // or you can only set roles in sub nav } }, { path: 'defined', component: () => import('@/views/permission/directive'), name: 'ProdDefiend', meta: { title: 'ProdDefiend', roles: ['admin', 'assistant', 'shoper'] // if do not set roles, means: this page does not require permission } } ] } export default prodRouter