<div>
<figure :style="{ 'background': 'url(' + item.main_featured + ') center no-repeat' }">
</div>
I want the style attribute background
to return a color if the URL from API is undefined
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">