[Vuejs]-Vue assign style based on object value

0👍

You can bind inline styles with v-bind:style or use the :style shorthand.

<div v-for"item in items" :style="{ backgroundColor: item.background }">
  {{item.name}}
</div>

You should read the Class and Style Binding Guide.

Leave a comment