index.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import Vue from 'vue'
  2. import VueRouter from 'vue-router'
  3. Vue.use(VueRouter)
  4. const routes = [{
  5. path: '/',
  6. name: '主页',
  7. component: () =>
  8. import ('@/views/home.vue')
  9. },
  10. {
  11. path: '/hours',
  12. name: '我的家',
  13. component: () =>
  14. import ('@/views/hours/hours.vue')
  15. },
  16. {
  17. path: '/food',
  18. name: '菜场',
  19. component: () =>
  20. import ('@/views/food/food.vue'),
  21. },
  22. {
  23. path: '/report/list',
  24. name: '日报列表',
  25. component: () =>
  26. import ('@/views/report/reportList/reportList.vue')
  27. },
  28. {
  29. path: '/report/detail/:id(\\d+)?', //+多位
  30. name: '日报的详情与修改',
  31. component: () =>
  32. import ('@/views/report/reportDetail/reportDetail.vue')
  33. },
  34. // {
  35. // path: '/report',
  36. // name: '日报',
  37. // redirect: '/report/list',
  38. // children: [{
  39. // path: 'list',
  40. // name: '列表',
  41. // component: () =>
  42. // import ('@/views/report/reportList/reportList.vue')
  43. // },
  44. // {
  45. // path: 'detail/:id(\\d+)?',
  46. // name: '详情与修改',
  47. // component: () =>
  48. // import ('@/views/report/reportDetail/reportDetail.vue')
  49. // }
  50. // ]
  51. // }
  52. ]
  53. const router = new VueRouter({
  54. mode: 'history',
  55. base: process.env.BASE_URL,
  56. routes
  57. })
  58. export default router