The scrollToTop property

The scrollToTop property lets you tell Nuxt to scroll to the top before rendering the page.


  • Type: Boolean (default: false)

By default, Nuxt scrolls to the top when you go to another page, but with children routes, Nuxt keeps the scroll position. If you want to tell Nuxt to scroll to the top when rendering your child route, set scrollToTop to true:

  1. <template>
  2. <h1>My child component</h1>
  3. </template>
  4. <script>
  5. export default {
  6. scrollToTop: true
  7. }
  8. </script>

Conversely, you can manually set scrollToTop to false on parent routes as well.

If you want to overwrite the default scroll behavior of Nuxt, take a look at the scrollBehavior option.