<div>
<figure :style="{ 'background': 'url(' + item.main_featured + ') center no-repeat' }">
</div>
I need the background
style attribute to display a color if the URL fetched from the API is undefined
For example:
If item.featured_photo
is not null
:
<figure style="background: url('localhost:6969/image.img') center no-repeat">
If item.featured_photo
is null:
<figure style="background: #FFF">