DEV Community

Discussion on: Vue.js and Binding to Radio Controls

Collapse
 
alexanderjanke profile image
Alex Janke

I hope this is the kind of thing you aimed for. Names update when you change them in the inputs and a 1 gets displayed next to the leader.

This also lets you easily add new users by just .push()-ing new values into the names array. The UI should update accordingly.

Let me know if I mixed something up

Collapse
 
steinbring profile image
Joe Steinbring

It isn't exactly what I'm aiming for. I'm not just looking to display a 1 for the leader. I want to have it available to pass to an API. You are correct that the team should really be in an array, though.

Collapse
 
alexanderjanke profile image
Alex Janke • Edited

You could now add a watcher to that array and pass the info to your API whenever something changed. Should work out :)