소스 검색

🐞 fix:修复路由二级路径

preschooler 11 달 전
부모
커밋
25dff95fed
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/router/index.ts

+ 1 - 1
src/router/index.ts

@@ -5,7 +5,7 @@ import remainingRouter from './modules/remaining'
 
 
 // 创建路由实例
 // 创建路由实例
 const router = createRouter({
 const router = createRouter({
-  history: createWebHistory(), // createWebHashHistory URL带#,createWebHistory URL不带#
+  history: createWebHistory(import.meta.env.VITE_BASE_PATH), // createWebHashHistory URL带#,createWebHistory URL不带#
   strict: true,
   strict: true,
   routes: remainingRouter as RouteRecordRaw[],
   routes: remainingRouter as RouteRecordRaw[],
   scrollBehavior: () => ({ left: 0, top: 0 })
   scrollBehavior: () => ({ left: 0, top: 0 })