fixed input-number null bug

This commit is contained in:
huanghong 2018-05-23 11:43:11 +08:00
parent 354254b414
commit 4d093b5070
2 changed files with 10 additions and 3 deletions

View file

@ -181,6 +181,7 @@
},
precisionValue () {
// can not display 1.0
if(!this.currentValue) return this.currentValue;
return this.precision ? this.currentValue.toFixed(this.precision) : this.currentValue;
},
formatterValue () {
@ -247,7 +248,10 @@
},
setValue (val) {
// step precision
if (!isNaN(this.precision)) val = Number(Number(val).toFixed(this.precision));
if(val){
if (!isNaN(this.precision)) val = Number(Number(val).toFixed(this.precision));
}
this.$nextTick(() => {
this.currentValue = val;