input框只能输入正整数

1.

 <el-input v-show="scope.row.edit"
         @keyup.native="pree(scope.row)"
         v-model="scope.row.supperHighCost" @blur="edit(scope.row)" style=" 60px"
 >

 </el-input>

//js
pree(row) { this.$set(row,'supperHighCost',row.supperHighCost.replace(/[^d.]/g,'')); },

2.

去除type=number样式

input::-webkit-outer-spin-button,
        input::-webkit-inner-spin-button {
            -webkit-appearance: none;
        }
        input[type="number"] {
            -moz-appearance: textfield;
        }
 <el-input v-show="scope.row.edit"
                                  type="number"
                                  v-model="scope.row.supperHighCost" @blur="edit(scope.row)" style=" 60px"
                        >

                        </el-input>
                                              
                        
不停学习,热爱是源源不断的动力。
原文地址:https://www.cnblogs.com/ximenchuifa/p/15049383.html