Here are my input fields:
<input v-model="form.sale_quantity" @change="computed" type="number" class="form-control" name="sale_quantity" id="sale_quantity" placeholder="Quantity">
<input v-model="form.sale_rate" @change="computed" type="number" step="any" class="form-control" name="sale_rate" id="sale_rate" placeholder="Rate">
<input v-model="form.sale_total" type="number" step="any" class="form-control" name="sale_total" id="sale_total" placeholder="Total Price">
I am using on change method to check whether the two input fields have some values and then calculate them.
data() {
return {
form: new Form({
sale_quantity: '',
sale_rate: '',
sale_total: '',
})
}
},
methods: {
computed() {
//computation here
}
}
So what should be my computed() method to check the input fields and calculate them to fill in the third input field?