InputNumber support null values

This commit is contained in:
huanghong 2018-03-16 13:59:59 +08:00
parent 14b7409b78
commit 10d29acb97
2 changed files with 11 additions and 1 deletions

View file

@ -178,7 +178,7 @@
return this.precision ? this.currentValue.toFixed(this.precision) : this.currentValue;
},
formatterValue () {
if (this.formatter) {
if (this.formatter && this.precisionValue !== null) {
return this.formatter(this.precisionValue);
} else {
return this.precisionValue;
@ -279,6 +279,10 @@
const isEmptyString = val.length === 0;
val = Number(val);
if(isEmptyString){
this.setValue(null);
return;
}
if (event.type == 'change'){
if (val === this.currentValue && val > min && val < max) return; // already fired change for input event
}