Skip to content

Commit a914d6a

Browse files
committed
perf: replaceState
1 parent f7d4f7c commit a914d6a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/.vitepress/theme/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ const handleCompatRedirect = async (router: Router) => {
115115
} else if (location.pathname === '/') {
116116
const r = getRedirectArg();
117117
const go = async (to: string) => {
118-
await router.go(to).catch(() => {});
118+
history.replaceState(null, '', to);
119+
await router.go(to);
119120
removeHiddenLayoutStyle();
120121
};
121122
if (r === '1') {

0 commit comments

Comments
 (0)