mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
9 lines
330 B
JavaScript
9 lines
330 B
JavaScript
export default defineNuxtRouteMiddleware((to, from) => {
|
|
useNuxtApp().hook('page:finish', () => {
|
|
if (to.path !== from.path && history.state.scroll) {
|
|
setTimeout(() => window.scrollTo(history.state.scroll), 0);
|
|
} else {
|
|
setTimeout(() => window.scrollTo(0, 0), 0);
|
|
}
|
|
});
|
|
});
|