fix InputNumber bug in 2.4.0, and release 2.4.0-beta.3

This commit is contained in:
梁灏 2017-09-24 16:21:48 +08:00
parent 7fdad3a3ca
commit cb2678c4b9
3 changed files with 8 additions and 5 deletions

View file

@ -161,7 +161,7 @@
},
precisionValue () {
// can not display 1.0
return this.currentValue.toFixed(this.precision);
return this.precision ? this.currentValue.toFixed(this.precision) : this.currentValue;
}
},
methods: {
@ -219,7 +219,9 @@
this.setValue(val);
},
setValue (val) {
val = Number(Number(val).toFixed(this.precision));
// step precision
if (this.precision) val = Number(Number(val).toFixed(this.precision));
this.$nextTick(() => {
this.currentValue = val;
this.$emit('input', val);