2 way data-binding in inputs Is it possible to use v-model on two inputs:
<form id="form-creator">
<input v-model="calculate" type="text" name="text">
<input value="@{{ calculate }} type="text" name="text-result">
</form>
I want to make calculations, e.g. if i type 1, it will make (1*750) and output that result on the second text-result. But it seems like v-model doesn't work with outputting result in another input.
Why is the second one an input? Does the user input anything?
Did you try using v-model on the second input?
@zachleigh , because it's a 2 way currency exchange calculator. Using the same v-model on the second value? It would duplicate it then.
Ah, I would use computed properties probably.
Thanks, but how to output result on the second input?
Maybe use v-model and a computed property, not the calculate property.
Can you throw an example?
On mobile now. I will when I get home, if nobody does before that time.
Here is my attempt on JSFiddle .
It requires you click ENTER after input though.
@zachleigh That's better too, but not yet. Try inserting 5 on the USD input and see
Please sign in or create an account to participate in this conversation.