Commit 815f835479f187a46b1443ed10607cd1d35e7343

Authored by Sergio Crisostomo
1 parent 4ef54c6e

Check if isNaN so we don't ignore value of zero

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
src/components/input-number/input-number.vue
... ... @@ -220,7 +220,7 @@
220 220 },
221 221 setValue (val) {
222 222 // 如果 step 是小数,且没有设置 precision,是有问题的
223   - if (this.precision) val = Number(Number(val).toFixed(this.precision));
  223 + if (!isNaN(this.precision)) val = Number(Number(val).toFixed(this.precision));
224 224  
225 225 this.$nextTick(() => {
226 226 this.currentValue = val;
... ...