Vue · Junior · Question 25 of 75

What does v-model on an input do?

<input v-model="name" />
<p>Hello, {{ name }}</p>

Explanation

On a text input v-model is sugar for :value="name" @input="name = $event.target.value". For checkboxes, radios and selects Vue uses the right property and event automatically.

Further reading

Problem with a question

Vue · Junior · question 25

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