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

214
Views
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 answers
Answer question

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 Report
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!