Skip to content
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

Curious about checkboxes and radiobuttons #52

Closed
lutostag opened this issue May 24, 2017 · 1 comment
Closed

Curious about checkboxes and radiobuttons #52

lutostag opened this issue May 24, 2017 · 1 comment
Assignees
Labels
Milestone

Comments

@lutostag
Copy link

lutostag commented May 24, 2017

I was curious if moon works with multiple checkboxes with the same name. It seems to bind it all together if I use the same model. Also I can't seem to get radiobuttons to work. I was expecting similar to
https://vuejs.org/v2/guide/forms.html#Checkbox -- the 'Multiple checkboxes, bound to the same Array' bit and https://vuejs.org/v2/guide/forms.html#Radio.

My stab at seeing if it would work. Am I just doing something silly? https://jsfiddle.net/fw8spum7/
I see that the checkboxes with different names work fine. Just hoping you might want to cater to this use-case.

Thanks for a great slim front-end, just what I was looking for!

@kbrsh
Copy link
Owner

kbrsh commented May 24, 2017

Hey!

You can use m-model to bind multiple checkboxes to a specific index of an array, and unlike Vue, you'll have the value in a guaranteed index. Vue, on the other hand, doesn't guarantee the index of the value of the checkbox in the array, but instead automates it.

I'll add a custom item to the code generator in v0.11.0 regarding radio buttons.

Let me know what you think

@kbrsh kbrsh added the feature label May 24, 2017
@kbrsh kbrsh self-assigned this May 24, 2017
@kbrsh kbrsh closed this as completed in 4b70821 May 26, 2017
@kbrsh kbrsh added this to the v0.11.0 milestone May 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants