Skip to content

Counter 动画计数器

数字递增动画组件,从起始值到结束值的动画过渡。

基础用法

vue
<template>
  <parrot-counter :end-value="9999" />
</template>

自定义起始值和精度

vue
<parrot-counter :start-value="0" :end-value="100" :precision="1" suffix="%" />

尺寸

vue
<parrot-counter :end-value="888" size="sm" />
<parrot-counter :end-value="888" size="md" />
<parrot-counter :end-value="888" size="lg" />

API

Props

属性类型默认值说明
endValuenumber0结束值
startValuenumber0起始值
durationnumber2000动画时长(ms)
precisionnumber0小数位
prefixstring''前缀
suffixstring''后缀
autoPlaybooleantrue自动播放

Events

事件说明
finished动画结束

Released under the MIT License.