收藏
回答

重复点击 input 组件时 bindblur被触发

wxml如下:

<text>{{destination.title}}</text><input type="text" bindblur="checkValue"  value="{{destination.value}}" data-name="{{destination.title}}" />

js如下

checkValue:function(e){
    console.log(e.detail.value);
    console.log(e)
    if (!(e.detail.value)){
      var that = this;
      this.setData({
        pickerDisabled : true,
      });
      wx.showToast({
        title: "请输入"+e.target.dataset.name,
        icon: 'warn',
        image: '',
        duration: 2000,
        mask: true,
        success: function(res) {},
        fail: function(res) {},
        complete: function(res) {},
      });
    }


重复点击 input 组件时,其绑定的 bindblur 事件被触发。

回答关注问题邀请回答
收藏

2 个回答

  • #
    #
    2017-05-11

    这样啊,谢谢

    2017-05-11
    有用
    回复
  • 2017-05-10

    试了下 开发工具确实有这个bug  但是手机是没有问题的

    2017-05-10
    有用
    回复
登录 后发表内容