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

304
Views
Getting a Vue Error: Cannot find module for image for dynamic image

I looked at Vue cannot find module image location and couldn't figure out a solution.

in my code when I hard code it

:src="require('@/assets/featured/pizzaOne.jpeg')"

I get the image. But when I try

:src="require(`${item.img}`)"

I get Error: Cannot find module '@/assets/featured/pizzaOne.jpeg' Not sure why and how to fix this

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

0

If you can change item.img to just name pizzaOne.jpeg, then in method:

methods: {
  getImgUrl: function (img) { 
     return require('@/assets/featured/' + img);
  }
}

end in template:

<img :src="getImgUrl(item.img)" />
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!