Files
SnowLuma/.pnpm-store/v11/files/a1/c701580e97439e501a5c6d7fdbf151ba5b666742c6fc450246381c9ef8acee3ccf8709df80db1cccef5b643b32552446292ea10bbeb1ebe09a79eab6f51b64
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

20 lines
713 B
Plaintext

//#region src/hash-scroll.ts
/**
* @private
* Handles hash-based scrolling after navigation completes.
* To be used in framework-specific <Transitioner> components during the onResolved event.
*/
function handleHashScroll(router) {
if (typeof document !== "undefined" && document.querySelector) {
const location = router.stores.location.get();
const hashScrollIntoViewOptions = location.state.__hashScrollIntoViewOptions ?? true;
if (hashScrollIntoViewOptions && location.hash !== "") {
const el = document.getElementById(location.hash);
if (el) el.scrollIntoView(hashScrollIntoViewOptions);
}
}
}
//#endregion
exports.handleHashScroll = handleHashScroll;
//# sourceMappingURL=hash-scroll.cjs.map