Vue calculation properties and methods

calculate the gap value by calculating properties and methods. If it is negative, the font is red, and the positive number is green

.
<div class="maintain_mon">
    <p class="tit">FYC

<ul v-for="item in numbs"> <li><i>{{item.checkValue}}</i>

</li> <li><i>{{item.currentValue}}</i>

</li> <li> <i>{{(item.currentValue - item.checkValue).toFixed(2)}}</i>

</li> </ul> </div> <div class="promote" v-for="module in arr"> <div class="maintain_mon" v-for="item in module.promote"> <p class="tit">{{item.tit}}

<ul v-for="item1 in item.assess"> <li><i>{{item1.checkValue}}</i>

</li> <li><i>{{item1.currentValue}}</i>

</li> <li> <i>{{item1.currentValue - item1.checkValue}.toFixed(2)}</i>

</li> </ul> </div> </div>

effect
clipboard.png

how to write judgment?

Mar.10,2022

js:

data () {
  return {
   
  }
},
methods: {
  diff: function (currentValue, checkValue) {
    return (currentValue - checkValue).toFixed(2)
  }
}

html:

 <li>
    <i :class='[diff(25, 5) > 0 ? "green-font" : "red-font"]'>{{diff(25, 5)}}</i>
    

</li>
Menu