index.js 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // import {createRouter, createWebHistory} from '@ionic/vue-router';
  2. import {createRouter, createWebHistory} from 'vue-router';
  3. import layout from '@/layout/index.vue'
  4. const routes = [
  5. {
  6. path: '/login',
  7. name: 'login',
  8. component: () => import('@/views/Login/index.vue'),
  9. },
  10. {
  11. path: '/',
  12. redirect: '/home',
  13. component: layout,
  14. children: [
  15. {
  16. path: 'home',
  17. name: 'home',
  18. component: () => import('@/views/HomeView.vue'),
  19. },
  20. {
  21. path: 'map',
  22. name: 'map',
  23. component: () => import('@/views/Map/index.vue'),
  24. },
  25. {
  26. path: 'inspect',
  27. name: 'inspect',
  28. component: () => import('@/views/Inspect/index.vue'),
  29. },
  30. {
  31. path: 'problem',
  32. name: 'problem',
  33. component: () => import('@/views/Problem/index.vue'),
  34. meta: {title: '问题列表'}
  35. },
  36. {
  37. path: 'about',
  38. name: 'about',
  39. component: () => import('@/views/AboutView.vue'),
  40. meta: {title: '我的'}
  41. },
  42. {
  43. path: 'inspect/:id/objects',
  44. name: 'inspectObjects',
  45. component: () => import('@/views/Inspect/Object/index.vue'),
  46. meta: {title: '工程列表', showBack: true}
  47. },
  48. {
  49. path: 'inspect/:id/object/:objId/problems',
  50. name: 'inspectObjectQuestions',
  51. component: () => import('@/views/Inspect/Object/Problem/index.vue'),
  52. meta: {title: '问题列表', showBack: true}
  53. },
  54. {
  55. path: 'problem/:id',
  56. name: 'problemDetail',
  57. component: () => import('@/views/Problem/detail/index.vue'),
  58. meta: {title: '问题详情', showBack: true}
  59. },
  60. {
  61. path: 'problemAdd',
  62. name: 'problemAdd',
  63. component: () => import('@/views/Problem/detail/index.vue'),
  64. meta: {title: '问题详情', showBack: true}
  65. },
  66. ],
  67. },
  68. ];
  69. const router = createRouter({
  70. history: createWebHistory(process.env.BASE_URL),
  71. routes,
  72. });
  73. export default router;