fixed input-number null bug
This commit is contained in:
parent
354254b414
commit
4d093b5070
2 changed files with 10 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue