index.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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: '/',
  7. redirect: '/home',
  8. component: layout,
  9. children: [
  10. {
  11. path: 'home',
  12. name: 'home',
  13. component: () => import('@/views/HomeView.vue'),
  14. },
  15. {
  16. path: 'map',
  17. name: 'map',
  18. component: () => import('@/views/Map/index.vue'),
  19. },
  20. {
  21. path: 'inspect',
  22. name: 'inspect',
  23. component: () => import('@/views/Inspect/index.vue'),
  24. },
  25. {
  26. path: 'question',
  27. name: 'question',
  28. component: () => import('@/views/Question/index.vue'),
  29. },
  30. {
  31. path: 'about',
  32. name: 'about',
  33. component: () => import('@/views/AboutView.vue'),
  34. meta: { title: '我的' }
  35. },
  36. ],
  37. },
  38. ];
  39. const router = createRouter({
  40. history: createWebHistory(process.env.BASE_URL),
  41. routes,
  42. });
  43. export default router;