标签:message replace length his span val amp err type
leftAdd0(){ var value=this.form.inputNum; var inputNum=this.form.inputNum.replace(/\s+/g,‘‘) var reg=/^[\d\s]+$/; if(!reg.test(value) && inputNum){ this.$message({ message:‘请输入数字‘, type:‘error‘ }) this.form.inputNum=‘‘ } else if(inputNum.length<15 && inputNum.length){ var length=15-inputNum.length; var str=‘‘; for(var i=0;i<length;i++){ str+=0; } this.form.inputNum=str+ inputNum; }else if(inputNum.length>15){ this.$message({ message:‘请输入不超过15位数字‘, type:‘error‘ }) this.form.inputNum=‘‘ } }
标签:message replace length his span val amp err type
原文地址:https://www.cnblogs.com/linm/p/13391246.html