Created
October 7, 2020 07:31
-
-
Save ThaddeusJiang/32807fcd7435820007c47e32cf38eff8 to your computer and use it in GitHub Desktop.
nuxt: page from Top when changing page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ref: https://nuxtjs.org/guides/features/file-system-routing#scrollbehavior | |
// ~/app/router.scrollBehavior.js | |
export default function (to, from, savedPosition) { | |
if (savedPosition) { | |
return savedPosition; | |
} else { | |
return { x: 0, y: 0 }; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment