mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-12-01 08:18:05 +09:00
Improve navigation
This commit is contained in:
parent
f64e5a17ea
commit
36368f5fd4
@ -54,6 +54,8 @@ if (localStorage.getItem('kyoppie') === 'yuppie') {
|
||||
location.reload(true);
|
||||
}
|
||||
|
||||
window.history.scrollRestoration = 'manual';
|
||||
|
||||
if (localStorage.getItem('theme') == null) {
|
||||
applyTheme(lightTheme);
|
||||
}
|
||||
|
@ -52,10 +52,13 @@ export const router = new VueRouter({
|
||||
],
|
||||
// なんかバギー
|
||||
scrollBehavior(to, from, savedPosition) {
|
||||
if (savedPosition) {
|
||||
return savedPosition;
|
||||
} else {
|
||||
return { x: 0, y: 0 };
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (savedPosition) {
|
||||
window.scroll({ top: savedPosition.y, behavior: 'instant' });
|
||||
} else {
|
||||
window.scroll({ top: 0, behavior: 'instant' });
|
||||
}
|
||||
}, 1000);
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user