fix: history lost

pull/973/head
stygian-desolator 3 years ago
parent e0b730aa8e
commit 20d2b7f1be

@ -48,8 +48,8 @@ export function createRouter(
} }
if (inBrowser) { if (inBrowser) {
// save scroll position before changing url // save scroll position before changing url
history.replaceState({ scrollPosition: window.scrollY }, document.title)
history.pushState(null, '', href) history.pushState(null, '', href)
history.replaceState({ scrollPosition: window.scrollY }, document.title)
} }
return loadPage(href) return loadPage(href)
} }

Loading…
Cancel
Save