diff --git a/middleware/route.global.js b/middleware/route.global.js index 3d2a54f4d..a763923e1 100644 --- a/middleware/route.global.js +++ b/middleware/route.global.js @@ -1,6 +1,6 @@ export default defineNuxtRouteMiddleware((to, from) => { useNuxtApp().hook('page:finish', () => { - if (to.path !== from.path && history.state) { + if (to.path !== from.path && history.state.scroll) { window.scrollTo(history.state.scroll); } else { window.scrollTo(0, 0);