<input
:value="principal"
data-type="account"
type="text"
maxlength="11"
placeholder-class="inp-palcehoder"
placeholder="请输入登录手机号"
@input="change"
@change="change"
pattern="[0-9]*"
/>
change(event) {
let val = event.target.value.trim();
// 只能是正整数或空,可根据需求修改正则
//item = e.target.value.replace(/[^\d]/g,'')
if (/^[1-9]\d*$|^$/.test(val)) {
this.oldNum = val;
} else {
event.target.value = this.oldNum;
}
this.principal = this.oldNum
},