Merge pull request #3676 from huanghong1125/input-number

fixed input-number null bug
This commit is contained in:
Aresn 2018-05-24 10:22:47 +08:00 committed by GitHub
commit 4b365f6326
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 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,7 @@
},
setValue (val) {
// step precision
if (!isNaN(this.precision)) val = Number(Number(val).toFixed(this.precision));
if (val && !isNaN(this.precision)) val = Number(Number(val).toFixed(this.precision));
this.$nextTick(() => {
this.currentValue = val;