In my view I have the following conditional class:
<td class="text-center" v-bind:class="{ positivity }"></td>
and in my component I have the following:
positivity: function() {
var type = typeof this.transaction.weeks != "undefined"
var positive = 'green-bold'
if ( type ) {
positive = 'red-bold'
}
return positive
}
...but then my computed class shows as:
<td class="text-center positivity"></td>
regardless of the result of positivity(). What am I doing wrong?