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