This website collects cookies to deliver better user experience
Vue Academy #2: V-model directive
Vue Academy #2: V-model directive
Welcome to the second vue academy ! It will be a list of lot of article on vue! I have 2.5 years of experience in this and I can teach a few thing about this !
For this course we will focus on v-model directive !
Let's start
First problematic, how do we manage an input value in <input> ?
We need to bind value of input to our current data message and handle event from this input in order to update our current data message.
It's not really friendly and we have to do this for every component...
v-model
You can use the v-model directive to create two-way data bindings on form input, textarea, and select elements. It automatically picks the correct way to update the element based on the input type.