zhengyiming
8 天以前 9d0a5366a2066fa1230cf0a008b5974ebfa54e33
src/router/index.ts
@@ -3,6 +3,7 @@
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'
@@ -295,9 +296,11 @@
  },
];
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) {