Vue.js Forms
In this section, we introduce the application of Vue.js forms.
You can use the v-model directive to create two-way data bindings on form control elements.

v-model automatically selects the correct method to update the element based on the control type.
Input Fields
The example demonstrates two-way data binding using v-model on input and textarea elements:
Try it »
Checkbox
A checkbox can be a boolean value, and multiple checkboxes bind to the same array:
Checkbox
The following example demonstrates two-way data binding of checkboxes:
Try it »
The effect of checking the checkboxes in the example is shown below:
Radio Button
The following example demonstrates two-way data binding of radio buttons:
Radio Button
Try it »
After selection, the effect is as shown below:

Select List
The following example demonstrates two-way data binding of a dropdown list:
select
Try it »
Select Example, the output effect is as shown below:

Modifiers
.lazy
By default, v-model syncs the input value with data on the input event, but you can add a lazy modifier to sync on the change event instead:
<!-- 在 "change" 而不是 "input" 事件中更新 --> <input v-model.lazy="msg" >
.number
If you want to automatically convert the user's input value to Number type (if the original value converts to NaN, the original value is returned), you can add a number modifier to v-model to handle the input value:
<input v-model.number="age" type="number">
This is usually useful because with type="number", the value entered in HTML is always returned as a string type.
.trim
If you want to automatically filter the leading and trailing spaces of user input, you can add the trim modifier to v-model to filter the input:
<input v-model.trim="msg">Other Extensions