Simple custom CheckBox component for Vue.js, compatible with v-model.
✓ Published0🌍 Public
KKopylovVitalik
Last edited Nov 23, 2019
Created on Apr 7, 2021
This example demonstrates a custom CheckBox component for Vue.js that integrates seamlessly with `v-model` for both single-value and array-based (multi-select) bindings. The component uses Vue’s `model` option, `props` like `value`, `modelValue`, `trueValue`, and `falseValue`, and emits a `change` event to update the bound data. It renders a stylized checkbox with hidden native input, custom `checkmark` styling via scoped PostCSS, and supports hover and checked states with a green accent color. The code shows array handling through `includes`, `push`, and `splice` methods.
AI-generated description