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

268
Visualizações
Router-link taking me to top of page instead of bottom of the page
<router-link to="/Signuppremium">
     <button class="bg-neutral-800 hover:bg-neutral-900 active:bg-neutral-800 text-red-700 hover:text-neutral-400 text-xl w-64 p-4 rounded-xl shadow cursor-pointer inline-block m-10 transition ease-in-out duration-300">Signup</button>
</router-link>

So I have the router-link working alright its just that when I arrive on the page i'm always at the bottom of the page, is there a way I can make it go to the top of the linked page so that the user doesn't have to scroll up all the time, thanks.

const router = createRouter({
    history: createWebHistory(),
    routes,
    scrollBehavior (to, from, savedPosition) {
      return { x: 0, y: 0 };
    }
})

  
  export default router;

I tried doing this in the router javascript but still goes to the bottom of the page.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Scroll Behavior Note: this feature only works if the browser supports history.pushState.

try

element.scrollTo(x, y);

about 4 years ago · Juan Pablo Isaza Relatório
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