0👍
First. I think you should provide image link on your API Response (so you should add image link column on your database table). Or if you insist, based on your case, you can use this:
<div v-if="item">
<h1>Price: {{ item.email }}</h1>
<img :src="getPic(item.email)"/>
</div>
and in your method:
getPic(src) {
return "@/assets/" + src.substring(0, src.lastIndexOf("@")) + ".png"
}
But I still really think you should store iamge link in your database
- [Vuejs]-Using ES6 in Vue.js
- [Vuejs]-Linear gradient in highcharts stockcharts according to full length date
Source:stackexchange.com