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
Vue : How to use v-bind on svg image?

I tried to load a svg image on img tag in two ways. When I use the 1st way then it works well, but when I use the 2nd way then it doesn't work.

How to make the 2nd way(v-bind:) working well?

<template>
    <div>
        <img src="../../assets/ico_refresh-ccwb.svg"> <!-- 1st : working -->
        <img :src="imgSrc"> <!-- 2st : not working -->
    </div>
</template>

<script>
export default {
    data(){
        return{
            imgSrc : '../../assets/ico_refresh-ccwb.svg'
        }
    }
}
</script>
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

@niddddddfier you need to prefix your imgSrc property with the require keyword. eg,

data(){
  return{
    imgSrc : require('../../assets/ico_refresh-ccwb.svg')
  }
}
  
over 4 years ago · Santiago Trujillo 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!