input格式校验(正整数)
1.只能输入正整数:
<el-input v-model="form.residualQuantity" @keyup.native="onlyNumber"></el-input>
//只能输入正整数 onlyNumber(){ if(this.form.residualQuantity){ this.form.residualQuantity = this.form.residualQuantity.replace(/[^\.\d]/g,''); this.form.residualQuantity = this.form.residualQuantity.replace('.',''); } },