Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

309
Views
not scrolling to top when route change in nuxtjs and locomotive together

I am using locomotive-scroll with nuxtjs and got some wired behave when changing route. after changing the route every time the page is start where i left scrolling my previous page. i tried nuxt scrollBehavior function which is work fine without using locomotive-scroll.

Below is my code which i put in my default.vue file

@Watch('$route')
  handleRouteChange(route: any, oldRoute: any) {
    this.$nuxt.$emit('update-locomotive');
  }

  mounted() {
    this.$nuxt.$on('update-locomotive', () => {
      (this as any).$refs.scroller.locomotive?.update();
    });

    if (process.browser && window) {
      this.retrieveCredential();
    }
  }

I am watching route change and updating the locomotive.

Thanks in advance

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!