carbon-components-vue
carbon-components-vue copied to clipboard
[CvCheckbox] doesn't work without a value
Detailed description
Using a cv-checkbox
requires a value
prop, even in use cases where no value is used. I frequently use cv-checkbox
es with v-model
, and to do so I have to feed an empty value
prop to keep the component from complaining.
Steps to reproduce the issue
- Create a checkbox with
v-model
but withoutvalue
:<cv-checkbox label="Some label" v-model="checkboxValue"/>
- See that an error is thrown because the
value
prop is required. The component still works as expected, and the model value is updated correctly. - Add the
value
prop with any string value, e.g.<cv-checkbox label="Some label" v-model="checkboxValue" value=""/>
- The error isn't thrown anymore, but functionally there is no difference.
If you're short on time I'd be glad to implement this, I didn't open a PR because the change is in a mixin, and I haven't had time to look into where that is used. In that case Slack me :)