index.js 715 B

123456789101112131415161718192021222324252627282930313233
  1. import { createRouter, createWebHistory, createWebHashHistory } from "vue-router";
  2. const router = createRouter({
  3. // history: createWebHistory(import.meta.env.BASE_URL),
  4. history: createWebHashHistory(),
  5. routes: [
  6. {
  7. path: "/",
  8. name: "main",
  9. component: () => import("../views/main/index.vue"),
  10. children: [
  11. {
  12. path: "map3d",
  13. name: "map3d",
  14. component: () => import("../views/map3d/index.vue"),
  15. meta: {
  16. keepAlive: true // 需要缓存
  17. }
  18. },
  19. {
  20. path: "transiton",
  21. name: "transiton",
  22. component: () => import("../views/transiton/index.vue"),
  23. meta: {
  24. keepAlive: false // 需要缓存
  25. }
  26. },
  27. ],
  28. },
  29. ],
  30. });
  31. export default router;