uniapp输入空格

时间:2020-07-15 13:07:12   收藏:0   阅读:436

uniapp   密码框输入空格(去除空格)的时候一直回显不及时  经过一番折腾 终于搞定

1.先赋值:     this.pwd = e.detail.value

2. 使用setTimeout(再次赋值 )

 setTimeout(() => { this.pwd = e.detail.value;this.pwd=this.pwd.replace(/\s+/g,‘‘);}, 0)

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!