Vue · Junior · Question 27 of 75
How does v-model work with several checkboxes bound to one array?
<input type="checkbox" value="vue" v-model="skills" />
<input type="checkbox" value="react" v-model="skills" />- ✓Correct answer: Checked values are added to the
skillsarray and unchecked ones are removed - 2Only the last checkbox is bound
- 3
skillsbecomestrueorfalse
Explanation
With an array, Vue adds or removes each checkbox's value. With a single checkbox bound to a boolean, it toggles true/false (or custom true-value/false-value).