|
|
@ -97,14 +97,8 @@ export function createRouter(
|
|
|
|
})
|
|
|
|
})
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
if (hash) {
|
|
|
|
if (hash) scrollTo(hash, cause?.classList.contains('header-anchor'))
|
|
|
|
scrollTo(
|
|
|
|
else window.scrollTo(0, 0)
|
|
|
|
hash,
|
|
|
|
|
|
|
|
cause ? cause.classList.contains('header-anchor') : false
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
window.scrollTo(0, 0)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -156,11 +150,8 @@ export function createRouter(
|
|
|
|
history.replaceState({}, '', href)
|
|
|
|
history.replaceState({}, '', href)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (targetLoc.hash && !scrollPosition) {
|
|
|
|
if (targetLoc.hash && !scrollPosition) scrollTo(targetLoc.hash)
|
|
|
|
scrollTo(targetLoc.hash)
|
|
|
|
else window.scrollTo(0, scrollPosition)
|
|
|
|
} else {
|
|
|
|
|
|
|
|
window.scrollTo(0, scrollPosition)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|