Two-way Binding
ELI5 — The Vibe Check
Two-way binding means your data and your input field are best friends who always tell each other what changed. Type in the box and the data updates. Change the data in code and the box updates. They stay perfectly in sync without you doing anything.
Real Talk
Two-way binding creates a bidirectional link between a form input element and a data property. In Vue it's achieved with v-model (syntactic sugar for
Show Me The Code
<!-- Vue: v-model is two-way binding sugar -->
<input v-model="searchQuery" placeholder="Search..." />
<p>You typed: {{ searchQuery }}</p>
<!-- Equivalent to: -->
<input :value="searchQuery" @input="searchQuery = $event.target.value" />
When You'll Hear This
"Use v-model for two-way binding on form inputs." / "React doesn't have two-way binding built in — you wire it up manually."
Related Terms
Angular
Angular is Google's JavaScript framework — the strict, opinionated one that comes with everything pre-decided.
Binding
Binding is connecting your data to your HTML so they stay in sync.
Directive
Directives are special HTML attributes that tell Vue (or Angular) to do something special with an element.
State
State is a component's memory — data that can change over time and causes the UI to update when it does. Think of a counter: the number is state.
Vue
Vue is a JavaScript framework for building interactive UIs. It's famous for being easy to pick up — HTML developers feel right at home.