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" />

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).

Further reading

Problem with a question

Vue · Junior · question 27

Test yourself

Take the Vue · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz