mirror of https://github.com/ElemeFE/element
InputNumber: fix invalid value (#1330)
parent
066eaf123e
commit
6cd01c2647
|
@ -175,15 +175,17 @@
|
|||
return (arg1 + arg2) / m;
|
||||
},
|
||||
increase() {
|
||||
if (this.value + this.step > this.max || this.disabled) return;
|
||||
this.currentValue = this.accAdd(this.step, this.value);
|
||||
const value = this.value || 0;
|
||||
if (value + this.step > this.max || this.disabled) return;
|
||||
this.currentValue = this.accAdd(this.step, value);
|
||||
if (this.maxDisabled) {
|
||||
this.inputActive = false;
|
||||
}
|
||||
},
|
||||
decrease() {
|
||||
if (this.value - this.step < this.min || this.disabled) return;
|
||||
this.currentValue = this.accSub(this.value, this.step);
|
||||
const value = this.value || 0;
|
||||
if (value - this.step < this.min || this.disabled) return;
|
||||
this.currentValue = this.accSub(value, this.step);
|
||||
if (this.minDisabled) {
|
||||
this.inputActive = false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue