turkalicious's avatar

Updating all form text fields at once

Hello all.

I am new to Vue and what I am trying to do is this. I am trying to have lets say 3 number input fields. That is the entire page, all right in the middle. It is a measure converter between KM, CM, MM and I want the user to be able to enter a number in any of them and the rest should populate automatically. If user enters in KMs, CM and MM should populate ... so and so fort.

I thought they would all be computed property but I could not make it work. Any help would be greatly appreciated. I am just trying to learn by practice. Thx

0 likes
2 replies
viktorivanov's avatar
Level 15

You can use a watcher to watch changes on any of them and on every change calculate and update their values.

Here's a quick jsfiddle

1 like

Please or to participate in this conversation.