Skip to content
loading...

Nativescript-vue STYLE

twitter logo github logo Updated on ・1 min read  

Condition in v-bind:Style - VueJS

27

I have an easy question for which I hope you could help:

<div>
  <figure :style="{ 'background': 'url(' + item.main_featured + ') center no-repeat' }">
</div>

I want the style attribute 'background' to return color if the URL from API is undefined

Example:

If item.featured_photo is not null:

<figure style="background: url('localhost:6969/image.img')

v-bind:style= "[condition ? {styleA} : {styleB}]"

day26

twitter logo DISCUSS
Classic DEV Post from Jun 5 '18

Make an Immutable Object - in Java

How to make an immutable object, in Java. Including common gotchas, design pattern considerations and what to do with bad data.

cem kaan profile image
fullstack coder looking for a remote job

DEV is a community of software developers

Sign up (for free)