Skip to content

3. 双向绑定

  1. 双向绑定一般用在表单标签中
  2. v-bind 只能 单向绑定
    html
       <!-- 请输入用户名: <input type="text" :value="username" /> -->
  3. v-model 实现数据的双向绑定
    html
       请输入用户名: <input type="text" v-model="username" /> <br />
  4. .number 将输入框的值转化位数字返回
    html
       请输入年龄: <input type="text" v-model.number="age" />

Released under the MIT License.