routes.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. keepAlive动态页面缓存:
  3. 路由文件的父级列表页,meta对象添加:(布尔类型)keepAlive: true
  4. 路由文件的子级详情页,meta对象添加:(数组)parentNode: [列表的name](父级列表页的name必须与对应.vue文件的name一致,且唯一)
  5. */
  6. // 显示在菜单中
  7. export const menuRouter =[
  8. {
  9. id: 0,
  10. name: 'goods',
  11. path: '/goods',
  12. meta: { title: '商品管理', icon: 'icon-shangpinguanli', keepAlive:true},
  13. component: () => import('@/pages/goods/index.vue'),
  14. },
  15. {
  16. id: 1,
  17. name: 'qualification',
  18. path: '/qualification',
  19. meta: { title: '类目管理', icon: 'icon-zizhiguanli', keepAlive:true},
  20. component: () => import('@/pages/qualification/index.vue'),
  21. },
  22. {
  23. id: 2,
  24. name: 'brand',
  25. path: '/brand',
  26. meta: { title: '品牌管理', icon: 'icon-pinpai', keepAlive:true},
  27. component: () => import('@/pages/brand/index.vue'),
  28. },
  29. ]
  30. // 不显示在菜单中的路由
  31. export const otherRouter = [
  32. {
  33. name: 'login',
  34. path: '/',
  35. meta: { title: '登录' },
  36. component: () => import('@/pages/login/index.vue'),
  37. },
  38. {
  39. name: 'addGoods',
  40. path: '/goods/addGoods',
  41. meta: { title: '商品信息' , keepAlive:true},
  42. component: () => import('@/pages/goods/addGoods/index.vue'),
  43. },
  44. {
  45. name: 'goodsDetail',
  46. path: '/goods/goodsDetail',
  47. meta: { title: '商品详情' ,keepAlive:true},
  48. component: () => import('@/pages/goods/goodsDetail/index.vue'),
  49. },
  50. {
  51. name: 'addCategory',
  52. path: '/qualification/addCategory',
  53. meta: { title: '类目申请' ,keepAlive:true},
  54. component: () => import('@/pages/qualification/addCategory/index.vue'),
  55. },
  56. {
  57. name: 'categoryDetail',
  58. path: '/qualification/categoryDetail',
  59. meta: { title: '类目详情' ,keepAlive:true},
  60. component: () => import('@/pages/qualification/categoryDetail/index.vue'),
  61. },
  62. {
  63. name: 'addBrand',
  64. path: '/brand/addBrand',
  65. meta: { title: '品牌申请' ,keepAlive:true},
  66. component: () => import('@/pages/brand/addBrand/index.vue'),
  67. },
  68. {
  69. name: 'brandDetail',
  70. path: '/brand/brandDetail',
  71. meta: { title: '品牌详情' ,keepAlive:true},
  72. component: () => import('@/pages/brand/brandDetail/index.vue'),
  73. },
  74. ]