Skip to content

Nativescript-vue STYLE

twitter logo github logo Updated on ・1 min read  

Condition in v-bind:Style - VueJS


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

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

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


If item.featured_photo is not null:

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

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


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)