Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

310
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda