输入框限制输入数字且最多保留两位小数
程序员文章站
2022-06-07 13:52:30
...
<el-input v-model="form4.jf" :disabled="dialogDbd4" maxlength="50" placeholder="请输入填写项" show-word-limit clearable onkeyup="var p2 = parseFloat(value).toFixed(2);value = p2>=0?(/\.0?$/.test(value)?value:p2.replace(/0$/,'').replace(/\.0$/,'')):''" onblur="value = value.replace(/\.0*$/,'')"></el-input>