例如要编辑已支付不能大于预估成本
<template slot-scope="{row}">
<template v-if="row.rowEdit">
<el-input v-model="settlementList.supplierPaidAmount"
@input.native="isTrueNum(row,$event);" />
</template>
methods: {
isTrueNum(row,event){
this.$nextTick(() => {
if(row.estimatedGenerationCost-event.target.value<0){
alert("超过值了,请重新输入")
//
event.target.value = event.target.value.slice(0,event.target.value.length-1)
this.settlementList.supplierPaidAmount=event.target.value
}
})
},
// 举一反三,假如要让编辑的长度不大于某个数直接在input里面写
οninput="if(value.length>5)value=value.slice(0, 5)"