From 20d2b7f1be48f54d267a9076fb261dfd3a5da90a Mon Sep 17 00:00:00 2001 From: stygian-desolator Date: Wed, 13 Jul 2022 08:57:56 +0800 Subject: [PATCH] fix: history lost --- src/client/app/router.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/app/router.ts b/src/client/app/router.ts index 39418559..d1798353 100644 --- a/src/client/app/router.ts +++ b/src/client/app/router.ts @@ -48,8 +48,8 @@ export function createRouter( } if (inBrowser) { // save scroll position before changing url - history.replaceState({ scrollPosition: window.scrollY }, document.title) history.pushState(null, '', href) + history.replaceState({ scrollPosition: window.scrollY }, document.title) } return loadPage(href) }