Skip to content

Commit 9c6b5eb

Browse files
YunaiVgitee-org
authored andcommitted
!544 【修复】修复路由二级路径VITE_BASE_PATH支持
Merge pull request !544 from 半栈幼儿员/hotfix/router
2 parents 3c34602 + 25dff95 commit 9c6b5eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/router/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import remainingRouter from './modules/remaining'
55

66
// 创建路由实例
77
const router = createRouter({
8-
history: createWebHistory(), // createWebHashHistory URL带#,createWebHistory URL不带#
8+
history: createWebHistory(import.meta.env.VITE_BASE_PATH), // createWebHashHistory URL带#,createWebHistory URL不带#
99
strict: true,
1010
routes: remainingRouter as RouteRecordRaw[],
1111
scrollBehavior: () => ({ left: 0, top: 0 })

0 commit comments

Comments
 (0)