常用正则匹配
常用正则匹配
常用正则匹配
常用正则匹配
表单校验只能输入包含0的正整数
1
2
3
4
5
checkInt2(value) {
const reg = /\d/;
if (value && reg.test(value)) return this.formData.other = parseInt(value);
return this.formData.other = value.replace(/[^\d]/g, "");
},
本文由作者按照 CC BY 4.0 进行授权