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