export default defineNuxtPlugin((nuxtApp) => { let previousPath: string | null = null; nuxtApp.hook("page:finish", () => { const currentPath = useRoute().fullPath; if (previousPath !== currentPath) { window.scrollTo(0, 0); previousPath = currentPath; } }); });