I have a table and I want to change the class depending on the value.
My first approach was to use v-bind:class="{} this will change to the right class if true. However doing like this I should create new elements for each value on my table which doesn't look like the best option.
Is there a way to use conditionals, like if {{value}} > 5 class:something
I wrote a small jsfiddle with how I got it working right now. The idea is that each element in the table will follow these rules without the need of write an if statement for each cell:
if (this.v1 < 4) {
this.goodBox = true
} else if (this.v1 < 6) {
this.goodBox = true
} else {
this.badBox = true
}