el-input 价格校验 大于0保留2位小数,不包含01,01.1这种

 <el-input
                      v-model="postFeeForm.cheapPayMoney"
                      type="number"
                      step="0.01"
                      placeholder="请输入金额"
                      class="table-input"
                      onkeyup="if(isNaN(value)||value<0){value =''}if(value.indexOf('.')<0){value=parseFloat(value)}if(value.indexOf('.')>0){value=value.slice(0,value.indexOf('.')+3)}"
                      :oninput="`if(value>${postFeeForm.maxcheapPayMoney})value=${postFeeForm.maxcheapPayMoney}`"
                      :disabled="setdisabled"
                      @input="cheapPrice"
                    />

  

posted @ 2021-12-31 17:07  柠檬青味  阅读(787)  评论(0编辑  收藏  举报