-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QUESTION: How do I v-model to a group of radio buttons? #7
Comments
I think the issue has to do with this line and this line. When the change event happens, the checked status is returned via the |
I hope form components themselves and the docs will be updated. <CFormCheck
type="radio"
name="my-radio"
id="radio1"
label="Radio 1"
value="1"
:checked="radioModel === '1'"
@click="radioModel = $event.target.value"
/>
<CFormCheck
type="radio"
name="my-radio"
id="radio2"
label="Radio 2"
value="2"
:checked="radioModel === '2'"
@click="radioModel = $event.target.value"
/> |
Well imagine 10 years passed but radios are not working with vue normally still. |
I'm using the CFormCheck component to allow the user to select an option, but I can't figure out how to get the value of the selected button back to my state variable. Should I be setting the
model-value
attribute? If so, how does that work? Every time I try to set it, the attribute takes on the valuetrue
no matter what value I pass in. Is there an example on the documentation site? Thank you.Example:
The text was updated successfully, but these errors were encountered: