Last active
December 2, 2023 18:46
-
-
Save softiconic/10b6cea722d4a245376eabadd5efa982 to your computer and use it in GitHub Desktop.
In Vue.js, scroll from the top to the bottom of a routed 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
scrollBehavior (to, from, savedPosition) { | |
if (savedPosition) { | |
return savedPosition | |
} else { | |
return { x: 0, y: 0 } | |
} | |
} | |
or try, | |
scrollBehavior() { | |
document.getElementById('app').scrollIntoView(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment