Improve navigation
This commit is contained in:
parent
d47d6bb12b
commit
149de5b17b
|
@ -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) {
|
||||||
|
setTimeout(() => {
|
||||||
if (savedPosition) {
|
if (savedPosition) {
|
||||||
return savedPosition;
|
window.scroll({ top: savedPosition.y, behavior: 'instant' });
|
||||||
} else {
|
} else {
|
||||||
return { x: 0, y: 0 };
|
window.scroll({ top: 0, behavior: 'instant' });
|
||||||
}
|
}
|
||||||
|
}, 1000);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue