input框输入值,默认得显示值消失

replace(/\s+/g, ‘’)即可
小程序示例:

  textInput(e) {
    
    
    this.setData({
    
    
      textContent: e.detail.value.replace(/\s+/g, '')
    })
  },

猜你喜欢

转载自blog.csdn.net/weixin_45324044/article/details/109162886