0

I want to send an input value to more than one data. I searched but couldn't find it, how can I do it? How can I do without method?

<input type="text" v-model="money_transfer.amount"/>

money_transfer: {
   amount: '', 
   source_amount: '', 
   target_amount: '', 
},

1 Answer 1

3

You can use this syntax to pass input value to multiple variables:

<input
   :value="money_transfer.amount"
   @input="money_transfer.amount = money_transfer.source_amount = money_transfer.target_amount = $event.target.value"
>
Sign up to request clarification or add additional context in comments.

3 Comments

The first one you wrote didn't work, but the 2nd one works.
Thanks. I am glad it helped you. I left only solution that works for you :)
Thank you, it looks like I misunderstood you at the beginning. I have edited my answer. Is everything ok now?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.