### input只允许输入整数和小数(小数只保留小数点后两位)

<el-input size="small" 

onkeyup="this.value=this.value.match(/\d+\.?\d{0,2}/)"

onafterpaste="this.value=this.value.match(/\d+\.?\d{0,2}/)"

v-model="scope.row.agentPrice"

maxlength="9"></el-input>

### input只允许输入整数

<el-input size="small" 

onkeyup="this.value=this.value.replace(/\D/g,'')"

onafterpaste="this.value=this.value.replace(/\D/g,'')"

v-model.number="scope.row.quantityNum" 

maxlength="9"></el-input>

 

<el-input v-model="dialogForm.username" maxlength="16" show-word-limit @input="(val) => (dialogForm.username = val.replace(/[^a-zA-Z0-9]/g, ''))

                        "></el-input>

Logo

前往低代码交流专区

更多推荐