VUE限制允許輸入數字的方法

<el-col :span="8">
                      <el-form-item label="税率:" prop="contactTaxRate">
                        <el-input v-model="form.contactTaxRate" :disabled="true"
                                  oninput="value=value.replace(/[^\d]/g,'')"
                                  placeholder="请输入税率" clearable>
                          <i slot="suffix" class="metre">%</i>
                        </el-input>
                      </el-form-item>
                    </el-col>

  

posted @ 2020-12-21 10:37  骇客黑界  阅读(79)  评论(0编辑  收藏  举报