Commit 10b42e26d20e36a88fb3f8e0c6bb914d78b57f5a

Authored by Aresn
Committed by GitHub
1 parent 4d093b50

Update input-number.vue

Showing 1 changed file with 1 additions and 4 deletions   Show diff stats
src/components/input-number/input-number.vue
... ... @@ -248,11 +248,8 @@
248 248 },
249 249 setValue (val) {
250 250 // 如果 step 是小数,且没有设置 precision,是有问题的
251   - if(val){
252   - if (!isNaN(this.precision)) val = Number(Number(val).toFixed(this.precision));
253   - }
  251 + if (val && !isNaN(this.precision)) val = Number(Number(val).toFixed(this.precision));
254 252  
255   -
256 253 this.$nextTick(() => {
257 254 this.currentValue = val;
258 255 this.$emit('input', val);
... ...