Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

126
Vistas
Vue <a @click="manageCookies()"> performs a redirect

I used to have the following code that worked smoothly:

<b-button @click="manageCookies()" variant="link">{{$t('app.cookies')}}</b-button>

A freelancer modified this code when redesigning the site this way:

<a @click="manageCookies()">{{$t('app.cookies')}}</a>

The problem is that I do not see the cookie dialog but the page is reloaded instead. This is the only difference. I suppose that the on click handler shall execute the javascript method, not the reload the page. The workaround is to add dummy href:

<a href="#" @click="manageCookies()">{{$t('app.cookies')}}</a>

Is this a correct way to handle the on click method?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

use prevent click event like this:

<a href="#" @click.prevent="manageCookies()">{{$t('app.cookies')}}</a>

this will prevent reload of page

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda