BeginnerCoder

Lesson 4 — v-model

Two-way binding with v-model

v-model connects a form field to a ref in both directions: typing updates the ref, and changing the ref updates the field. It replaces writing a value binding plus an input event handler by hand.

<input v-model="email" />
<p>We will write to {{ email }}</p>

Why it matters: every form in a Vue app — search, login, checkout — uses v-model.

Want it another way?
Task

Connect the input to text with v-model. Typing hello should show "You typed: hello".

← Back
Next →
Test your knowledge

A quick 3-question quiz on this lesson — instant feedback.

Enjoying this lesson? Share it.