<el-input v-model="scope.row.variables.leaderbuweiscores.score" @keyup.native="changeInput(scope.row)" onmousewheel="return false;" οninput="value=value.replace(/[^\d.]/g,'')" type="number" :disabled="scope.row.leaderBumenRoleId != user.roleId || notEnd">
原因:
e在數學上代表2.71828,所以它也還是一個數字
在網上找了很多方案發現用起來都不是很方便, 最后用正則來做是比較簡單的
解決方案:
直接在input標簽內加一個屬性 οninput="value=value.replace(/[^\d]/g,'')" 即可完美解決
如果有其他輸入需求, 直接修改正則表達式即可, 例:
允許輸入小數: οninput="value=value.replace(/[^\d.]/g,'')"