1、单向数据绑定
v-bind:数据只能从data流向页面;
写法:v-bind:value="xxx",简写:value="xxx";
<input type="text" v-bind:value="name" />
<input type="text" :value="name" />
2、双线数据绑定
v-model:数据不仅可以从data流向页面,也可以从页面流向data;
v-model一般都应用在表单类元素上(如input select等等),这些元素都有value属性;
v-model:value可以简写为v-model,因为v-model默认收集的就是value的值;
<input type="text" v-model:value="name" />
<input type="text" v-model="name" />