2 回复
<input type=‘text’ data-name=‘account’ value=’{{account}}’ name=“account” bindinput=‘verification’ bindblur=‘account_val’></input>
verification: function (e) {
var name = e.currentTarget.dataset.name;
this.setData({
[name]: e.detail.value.replace(/\s+/g, ‘’)
})
}
利用简单的正则实时去除空格