Skip to content

Instantly share code, notes, and snippets.

@Sammyjo20
Created February 7, 2022 08:15
Show Gist options
  • Save Sammyjo20/3239b026b83118fcc1452635c6337ff9 to your computer and use it in GitHub Desktop.
Save Sammyjo20/3239b026b83118fcc1452635c6337ff9 to your computer and use it in GitHub Desktop.
Vue 2 Router Fix Scroll Position
const router = new VueRouter({
routes: routes,
scrollBehavior (to, from, savedPosition) {
return { x: 0, y: 0 }
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment