Dedicated Vue.js Checkbox Component
Ivan Dwijaya

Hi Ivan Dwijaya. On your “I can’t pass optional attributes like id , disabled , required without specifying a props for each possible attribute.”: You actually can. Vue passes all default arguments to the root element of your component. If you want to change that behaviour, you can. By setting inheritAttrs to `false` and setting `v-bind=”$attrs”` on your `<input type=”checkbox”>` inside your component template, all attributes are passed to the input element.

More on inherit attributes:

Like what you read? Give Warre Buysse a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.