vue input 只允许输入整数、整数和小数(保留小数点后两位)
###input只允许输入整数和小数(小数只保留小数点后两位)<el-inputsize="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"ma
·
### 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>
更多推荐
已为社区贡献3条内容
所有评论(0)