代码:
HTML
通过@input事件来进行输入的筛选
<el-form-item label="图文排序">
<el-input size="small" v-model="imageTextForm.imageTextSeqNum"
placeholder="请填写图文排序(数字)"
@input="imageTextInputChange" maxlength="3"></el-input>
</el-form-item>
JavaScript
imageTextInputChange(val) {
this.imageTextForm.imageTextSeqNum = val.replace(/[^\d]/g, '')
},