0👍
if i understand you correctly,, you want form.price_vat
to change, every time you change form.price_user
by typing inside the input.
you can do this using watch
. just add the below your methods
in vue:
watch:{
'form.price_user':function():{
this.form.price_vat += 1
},
}
so in this code, you update the value of form.price_vat
by 1 every time the form.price_user
changes. you can do anything inside the function of watch
.
the complete vue
part will be :
data(){
return:{
form:{
price_vat :'',
price_user : '',
}
}
},
methods:{},
watch:{
'form.price_user':function():{
this.form.price_vat += 1
},
}
- [Vuejs]-Vue application. How to skip authentication to show some component?
- [Vuejs]-Vue JS get Json object list with axios
Source:stackexchange.com