<el-input v-model="scope.row.giveUpAmount" :disabled="scope.row.existCWH" oninput="value=value.replace(/^.+|[^d]+/g,'')" />
1. js文本框输入正整数和0的验证
oninput="value=value.replace(/^.+|[^d]+/g,'')"
最简单的html代码实现输入框只能输入正整数,输入同时禁止了以0开始的数字输入,防止被转化为其他进制的数值。
2.
<el-input v-model="scope.row.supportAmount" :disabled="scope.row.existCWH" oninput="value=value.replace(/^(0+)|[^d]+/g,'')" />
oninput="value=value.replace(/^(0+)|[^d]+/g,'')"