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

85
Views
Set a props as part of href attribute in VueJS

I have defined an icon component and I want the props to be attached to the href link address as part of the URL. How can this be done correctly?

In fact, I want the amount of attribute href to look like this:

href="./img/icon.svg#ico_copy"

Vue.component('icon', {
  template: `
  <svg class="iconz">
  <use v-bind:href="'./img/icon.svg#'+ props.label"></use>
  </svg>`,
  props: {
    label: String,
  },
});
  <icon label="ico_copy"></icon>

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

you can create a computed property like this:

computed: {
  url() {
    return `./img/icon.svg#${this.label}`;
  }
}
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!