JSFiddle - React, Tailwind, and code Playground
HTML
<input type="number" v-model="down_payment" class="form-control-right" placeholder="Downpayment" number>
<input type="number" v-model="loan_amount" placeholder="Loan Amount" number>
JavaScript
new Vue({
el: 'body',
data: {
asking_price: 60000,
down_payment: 20
},
computed: {
loan_amount: {
get: function() {
return this.asking_price - this.down_payment;
},
set: function(newValue) {
this.down_payment = this.asking_price - newValue;
}
}
}
});