vant-weapp:爬坑,其组件Field中的属性value并不是双向数据绑定

需要使用方法,比如失去焦点,获取其输入值
html

<van-field :value="mes.id_card" placeholder="请输入您得身份证号" :border="false " label="身份证号" @blur='myBlur($event,"id_card")' />

js

myBlur: function (e, name) {
  console.log(e)
  console.log(name)
  if (name === 'name') {
    // 姓名
    this.mes.name = e.mp.detail.value
  } else if (name === 'id_card') {
    // 身份证号
    this.mes.id_card = e.mp.detail.value
  } else if (name === 'description') {
    this.mes.description = e.mp.detail.value
  }
},
发布了108 篇原创文章 · 获赞 29 · 访问量 11万+

猜你喜欢

转载自blog.csdn.net/Gabriel_wei/article/details/98205010