Skip to content
Advertisement

How to v-for checked value

I’m trying to create a checkbox select only one.

JavaScript

My JS looks like the following:

JavaScript

This is the old result.

enter image description here

I’m trying to get results like this.

enter image description here

I can do this by not the v-for method, but I want to do it this way. Because I have a lot of data, How can I checked value in v-for?

Here is my pen: enter link description here

Advertisement

Answer

You are missing the value binding (:value), here’s your example fixed:

JavaScript
JavaScript

Documentation

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement