<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,'')"