I have multiple inputs that have a class bound which is triggered if less than 0. All inputs are similar to the one below. My issue is when one the target input is triggered, all inputs with this class bound are triggered instead of just the one. What's the best way to handle this? All inputs are bound to a single variable not shared by any other input. Thanks!
<td>
<input type="number" v-bind:class="{ negative: isNegative }"
v-model="totalNetProfit">
</td>
totalNetProfitCalculation() {
this.totalNetProfit = this.totalLotRevenue - this.totalLotCost;
if (this.totalNetProfit < 0) {
this.isNegative = true;
}
},
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire