Inforage
Inforage

Reputation: 79

How use object in image tag src

How can I use object in img src?

// html
<img src= "item.img"

Sample

Upvotes: 1

Views: 369

Answers (1)

Amaarockz
Amaarockz

Reputation: 4684

Below is a way to pass the url

<img :src="item.img"

if the above doesn't work then try the same using require just as below

<img :src="require(item.img)"

Assuming that item is an object with img property present in it

Upvotes: 1

Related Questions