import { createRouter, createWebHistory, createWebHashHistory } from "vue-router"; const router = createRouter({ // history: createWebHistory(import.meta.env.BASE_URL), history: createWebHashHistory(), routes: [ { path: "/", name: "main", component: () => import("../views/main/index.vue"), children: [ { path: "map3d", name: "map3d", component: () => import("../views/map3d/index.vue"), meta: { keepAlive: true // 需要缓存 } }, { path: "transiton", name: "transiton", component: () => import("../views/transiton/index.vue"), meta: { keepAlive: false // 需要缓存 } }, ], }, ], }); export default router;