pull/4511/head
Divyansh Singh 8 months ago
parent e17e741157
commit 9ab6d75592

@ -84,11 +84,11 @@ export function createRouter(
{ smoothScroll = false, initialLoad = false } = {} { smoothScroll = false, initialLoad = false } = {}
) { ) {
href = normalizeHref(href) href = normalizeHref(href)
const loc = inBrowser ? normalizeHref(location.href) : null
if ((await router.onBeforeRouteChange?.(href)) === false) return if ((await router.onBeforeRouteChange?.(href)) === false) return
if (loc !== null) { if (inBrowser) {
const loc = normalizeHref(location.href)
const { pathname, hash } = new URL(href, fakeHost) const { pathname, hash } = new URL(href, fakeHost)
const currentLoc = new URL(loc, fakeHost) const currentLoc = new URL(loc, fakeHost)

Loading…
Cancel
Save