scroll to top router link vue

export default new Router({
  scrollBehavior() {
    return { x: 0, y: 0 };
  },
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home
    }
  ],
  mode: 'history'
});

3.67
3
Andrew 80 points

                                    scrollBehavior(to, from, savedPosition) {  return { x: 0, y: 0 };}

3.67 (3 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
router link top page vuesjs vue router link to top of page vue router scroll to top of page scroll to top after vue router navigation vue router push scroll to top scroll to top on link vue js vue router when change route scroll to top vuejs routerlink click scroll to top after route change scroll to top vue vue router scroll to top on route change vue scroll router-view to top vue router scroll top vue router scroll top wach new route vue scroll to top after route change vue app scroll to top after route navigation vue.js router-link scroll to top scroll on top vue js route vue router scroll to top vue.js scroll to top with router vue 3 scroll to top route change scroll to top on route change vue scroll to top vue router vue js scroll to top on route change Changing route doesn't scroll to top in the new page vue vuejs page transition instead of scrolling scroll behaviour vuejs vue router link jump to top vue router save data to savedposition vue router save to savedposition vue router save scroll position vue router disable scroll to top on page change vue router beforeach scroll vue route scroll position always open on the top of the page vue router vuejs page scroll position vue router use savePosition in router link vue router conditional scroll behaviour based on route vue js router link to top of page vue js router link to top vue route on top of other route this.Route offset vue vue change route scroll middle? scroll to element after route change vue scroll for details vue automatically update url when scrollin vue scroll behavior vuejs vue router scroll to top after navigation vue route change scroll to nuxt link scroll to top vue router y browser scroll to the previous position with vue js vue scroll to top on route change vue router link scroll to top vuejs scroll to top of page on route change start from top vue js scrollbehavior vue scroll behavior vue router vue open page and scroll scroll to element after route load in vue vue js scroll to element with route change goto other route and scroll to that content in vue js v scroll with route vuej router open page from middle router scroll behavior scrollbehavior vue router vuejs router scroll to top v scroll to current position vuejs vue reset scroll position vue scrollBehavior page scroll in vuejs scroll to top router link vue
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source