Problem Statement
How does v-model behave on checkboxes and radio buttons?
Explanation
On a single checkbox, v-model binds to a boolean. On a checkbox group, it binds to an array of selected values. On radio inputs, v-model binds the selected radio’s value to the state.
Code Solution
SolutionRead Only
<!-- single --> <input type="checkbox" v-model="isOn"> <!-- group --> <input type="checkbox" value="a" v-model="picked"> <input type="checkbox" value="b" v-model="picked"> <!-- radio --> <input type="radio" value="light" v-model="theme">