> For the complete documentation index, see [llms.txt](https://zpliu.gitbook.io/booknote/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zpliu.gitbook.io/booknote/vue/10-biao-dan-shu-ru-de-bang-ding.md).

# 表单输入绑定

## 1.基本用法

​ `v-model`在input textarea及select中创建双向的数据绑定，即将数vm数据与用户输入进行绑定

​ > v-model 会忽略表单中的 `value`,`checked`,`selected`的属性的初始值，将Vue实例的数据作为数据来源

## 5.修饰符

1. `v-model.lazy=数据`v-model在每次input事件触发后会将输入框的内容与数据进行同步，加上修饰符之后，只有输入框内容与数据不同时才会进行数据同步
2. .numbwe 默认用户的所有输入都是字符串，所以当有数字类型的字符输入时，可以使用该修饰符
3. .trim自动过滤用户输入的首尾空白符
