找回密码
 立即注册
搜索

已解决 判断input框内容是否全为空格

0
回复
1775
查看
[复制链接]

5

主题

10

帖子

75

积分

 楼主| 2018-12-28 12:20:47 显示全部楼层 |阅读模式
html部分: <input type="text" @change="alterText"/> js部分: alterText (e) { this.alterTextCon = e.value; if(this.alterTextCon.replace(/\s/g, '12').length == 2*this.alterTextCon.length) { console.log(内容全为空格); } },
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册