mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-14 05:57:32 -07:00
Improve navigation
This commit is contained in:
parent
f64e5a17ea
commit
36368f5fd4
2 changed files with 10 additions and 5 deletions
|
@ -54,6 +54,8 @@ if (localStorage.getItem('kyoppie') === 'yuppie') {
|
||||||
location.reload(true);
|
location.reload(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.history.scrollRestoration = 'manual';
|
||||||
|
|
||||||
if (localStorage.getItem('theme') == null) {
|
if (localStorage.getItem('theme') == null) {
|
||||||
applyTheme(lightTheme);
|
applyTheme(lightTheme);
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,10 +52,13 @@ export const router = new VueRouter({
|
||||||
],
|
],
|
||||||
// なんかバギー
|
// なんかバギー
|
||||||
scrollBehavior(to, from, savedPosition) {
|
scrollBehavior(to, from, savedPosition) {
|
||||||
if (savedPosition) {
|
setTimeout(() => {
|
||||||
return savedPosition;
|
if (savedPosition) {
|
||||||
} else {
|
window.scroll({ top: savedPosition.y, behavior: 'instant' });
|
||||||
return { x: 0, y: 0 };
|
} else {
|
||||||
}
|
window.scroll({ top: 0, behavior: 'instant' });
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue