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

215
Vistas
Any way to make an anchor tag clickable if it's placed inside router-link?

I have this component:

<template>
  <div id="news" class="news page">
    <router-link class="news-card" :to="{ name: 'news-article'}">
      <a :href="'https://www.facebook.com'">www.facebook.com</a>
    </router-link>
  </div>
</template>

and I want to make the anchor tag clickable so that it opens the URL https://www.facebook.com.

I've tried lifting it in priority with z-index but it doesn't seem to work:

<style scoped lang="scss">
.news {
  .news-card {
    position: relative;
    z-index: 1;
    a {
      position: relative;
      z-index: 2;
      &:hover {
        color: red;
      }
    }
  }
}
</style>

The hover effect on the anchor works, but not the href property. Any idea how to do that?

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

0

router-link is basically a a tag, so you basically have an a tag inside of an a tag. I assume when clicking on www.facebook.com it would take you to { name: 'news-article' } instead of facebook.

This is what you wanna do I guess..

<template>
  <div id="news" class="news page">
    <router-link class="news-card" to="https://www.facebook.com">
         www.facebook.com
    </router-link>
  </div>
</template>
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