| | |
| | | import Layout from '@/layout/MainLayout/Layout.vue'; |
| | | import ErrorLayout from '@/layout/ErrorLayout/ErrorLayout.vue'; |
| | | import { AppType } from '@/constants'; |
| | | import { loadEnv } from '@build/index'; |
| | | |
| | | // import { ElIcons } from '@/typings' |
| | | |
| | |
| | | }, |
| | | ]; |
| | | |
| | | const { VITE_PUBLIC_PATH } = loadEnv(); |
| | | |
| | | const createRouterFactory = () => |
| | | createRouter({ |
| | | history: createWebHistory(), // hash模式:createWebHashHistory,history模式:createWebHistory |
| | | history: createWebHistory(VITE_PUBLIC_PATH), // hash模式:createWebHashHistory,history模式:createWebHistory |
| | | scrollBehavior(to, from, savedPosition) { |
| | | return new Promise((resolve) => { |
| | | if (savedPosition) { |