xlsdg / vue-countup-v2

Vue.js component wrap for countUp.js
https://inorganik.github.io/countUp.js/
MIT License
379 stars 56 forks source link

decimalPlaces属性配置无效,不能保留二位小数 #26

Closed wenjunzhangp closed 4 years ago

wenjunzhangp commented 4 years ago

countup.js version 2.0.7

vue-countup-v2 version 4.0.0

代码如下:

import ICountUp from 'vue-countup-v2';

components: {
    ICountUp
 },

<ICountUp :startVal="0"
    :endVal="88.25"
   :decimalPlaces="2"
   :duration="2"
  :options="options"
/>

效果图:

image

wenjunzhangp commented 4 years ago

我好像知道原因了,4.0.0的版本中跟本没有 decimalPlaces 这个属性

wenjunzhangp commented 4 years ago

解决办法是在 options 中定义 decimalPlaces 字段。

cdecinkoKnight commented 3 years ago

Why was this not documented? How do I pass a dynamic value when that is the only option I need to change on the fly?