How to set different styles for labels according to the positive and negative numbers?

In

vue, what if the attribute number of an object is greater than 0 to set .style1, less than 0 to set .style2, and equal to 0 to set .style3?

data : {
   data1: 12,
   data2: -12,
   data3: 0
}

<div :class="">{{data.data1}}</div>
<div :class="">{{data.data2}}</div>
<div :class="">{{data.data3}}</div>
Mar.29,2021

you can do it in methods to keep it simple.
Html:

  http://www.runoob.com/vue2/vu.


					
Menu