源码是这样的
html:
<input class="weui-input" type="number" placeholder="请输入受让人手机号" value="{{tmessage.tphone}}" maxlength="11" bindinput="setPhoneValue" name="tphone" />
js:
setPhoneValue: function (e) {
var that = this;
that.setData({
'tmessage.tphone': e.detail.value
})
}
把bindinput换成bindblur 或者bindconfirm则不会出现按一下键盘就收起的情况,但是我手机设置了按键音,input只要聚焦按键音就会一直卡卡的响
var tmessage = that.data.tmessage
var tmessage.tphone = e.detail.value 别再setPhoneValue函数中setdata