|
|
@ -72,11 +72,11 @@ export function createRouter(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async function go(href: string = inBrowser ? location.href : '/') {
|
|
|
|
async function go(href: string = inBrowser ? location.href : '/') {
|
|
|
|
if ((await router.onBeforeRouteChange?.(href)) === false) return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
href = normalizeHref(href)
|
|
|
|
href = normalizeHref(href)
|
|
|
|
const loc = inBrowser ? normalizeHref(location.href) : null
|
|
|
|
const loc = inBrowser ? normalizeHref(location.href) : null
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ((await router.onBeforeRouteChange?.(href)) === false) return
|
|
|
|
|
|
|
|
|
|
|
|
if (loc !== null && href !== loc) {
|
|
|
|
if (loc !== null && href !== loc) {
|
|
|
|
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)
|
|
|
|