Input event 12 / 42
Let's actually sync the state with the input by listening to the @input
event. Whenever you type, it updates the name
state (two-way data binding).
Vue injects the $event
variable to give us access to the input event object inside the template so we can get the value from the input.
Try changing @input
to @change
to listen for the change event instead.