[Vuejs]-How do I dynamically add CSS classes to HTML elements if value is less or greater than 0?

0👍

You should try binding class.
Something like that:

<div :class="getDivClasses(value.USD.PRICE)">

and inside methods:

getDivClasses(value) {
  return value > 0 ? "positive" : "negative";
},

Leave a comment