prod.js 1.12 KB
/** When your routing table is too long, you can split it into small modules**/

import Layout from '@/layout'

const prodRouter = {
  path: '/prod',
  component: Layout,
  redirect: '/prod/page',
  alwaysShow: true, // will always show the root menu
  name: 'Prod',
  meta: {
    title: 'prods.prod_menu', // 会自动被i18n替换
    icon: 'star',
    roles: ['admin', 'assistant', 'runner', 'shoper'] // you can set roles in root nav
  },
  children: [{
    path: 'list',
    component: () => import('@/views/prod/list'),
    name: 'ProdList',
    meta: {
      title: 'prods.prodlist',
      roles: ['admin', 'assistant', 'shoper', 'runner']
    }
  }, {
    path: 'edit/:pid(\\d+)',
    component: () => import('@/views/prod/edit'),
    name: 'ProdEdit',
    meta: {
      title: 'prods.prodedit',
      noCache: true,
      activeMenu: '/prod/list'
    },
    hidden: true
  }, {
    path: 'create/:fid(\\d+)',
    component: () => import('@/views/prod/create'),
    name: 'ProdCreate',
    meta: {
      title: 'prods.prodcreate',
      noCache: true,
      activeMenu: '/prod/list'
    },
    hidden: true
  }]
}

export default prodRouter