lundi 27 mars 2017

Is it possible to activate a class for an individual v-bind without triggering others?[VueJS / Laravel]

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; 
        }
    },



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2mJonpR
via IFTTT

Aucun commentaire:

Enregistrer un commentaire