index.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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: 'inspect/:id/objects',
  32. name: 'inspectObjects',
  33. component: () => import('@/views/Inspect/Object/index.vue'),
  34. },
  35. {
  36. path: 'inspect/:id/object/:objId/questions',
  37. name: 'inspectObjectQuestions',
  38. component: () => import('@/views/Inspect/Object/Question/index.vue'),
  39. },
  40. {
  41. path: 'question',
  42. name: 'question',
  43. component: () => import('@/views/Question/index.vue'),
  44. },
  45. {
  46. path: 'about',
  47. name: 'about',
  48. component: () => import('@/views/AboutView.vue'),
  49. meta: { title: '我的' }
  50. },
  51. ],
  52. },
  53. ];
  54. const router = createRouter({
  55. history: createWebHistory(process.env.BASE_URL),
  56. routes,
  57. });
  58. export default router;