fix(client): no onAfterRouteChanged called after popstate (#3227)

closes #3226
pull/3248/head
DY_XiaoDong 11 months ago committed by GitHub
parent ef6d8d1e42
commit 60fc8fd244
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -222,11 +222,12 @@ export function createRouter(
{ capture: true }
)
window.addEventListener('popstate', (e) => {
loadPage(
window.addEventListener('popstate', async (e) => {
await loadPage(
normalizeHref(location.href),
(e.state && e.state.scrollPosition) || 0
)
router.onAfterRouteChanged?.(location.href)
})
window.addEventListener('hashchange', (e) => {

Loading…
Cancel
Save