refresh blink fix
parent
63d1a6bd9c
commit
076e37847c
|
@ -1,9 +1,9 @@
|
||||||
export default defineNuxtRouteMiddleware((to, from) => {
|
export default defineNuxtRouteMiddleware((to, from) => {
|
||||||
useNuxtApp().hook('page:finish', () => {
|
useNuxtApp().hook('page:finish', () => {
|
||||||
if (history.state.scroll) {
|
if (to.path !== from.path && history.state) {
|
||||||
setTimeout(() => window.scrollTo(history.state.scroll), 0);
|
window.scrollTo(history.state.scroll);
|
||||||
} else {
|
} else {
|
||||||
setTimeout(() => window.scrollTo(0, 0), 0);
|
window.scrollTo(0, 0);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue