Skip to content
On this page

配置设置

通过 start 设置开始的数字,通过end 设置结束数字,通过 autoPlay 是否自动播放,通过 duration 持续时间,通过 prefix 设置字体前置符号,通过 suffix 设置字体后置符号,通过 useEasing 设置滚动结束后是否开启拖尾,通过 separator 设置千分位分隔符

html
<uv-count-to
  :start="0"
  :end="endCount"
  :auto-play="true"
  :duration="2000"
  prefix=""
  suffix="RMB"
  font-size="30px"
  color="#f56c6c"
/>

字体属性

通过 prevText 设置上一页,通过 nextText 设置下一页,也可以使用插槽 prev 自定义上一页,通过 next 自定义下一页

html
<uv-count-to
 :start="0"
 :end="endCount"
 :auto-play="true"
 :duration="2000"
 font-size="30px"
 color="#f56c6c"
 bold
/>

props

属性含义类型默认值
start开始数字Number0
end结束数字Number0
duration动画持续时间Number5000
autoPlay是否自动播放Booleantrue
decimals要显示的小数位数Number0
decimal十进制分割String'.'
separator千分位分隔符String','
prefix前缀符号String-
suffix后缀符号String-
useEasing滚动结束时,是否缓动结尾Booleantrue
easingFnFunction(return c * (-Math.pow(2, -10 * t / d) + 1) * 1024 / 1023 + b)
fontSize字体大小String
bold字体是否加粗Booleanfalse
color字体颜色String-

events

事件名称含义参数
onMountedcallbackdom挂在完成后执行-
callback动画结束后的回调-

css变量

css
--uv-pagination-font-size: 14px;
  --uv-pagination-content-item-size: 34px;
  --uv-pagination-content-item-color: #606266;
  --uv-pagination-content-item-gap: 8px;
  --uv-pagination-content-item-border-radius: 2px;
  --uv-pagination-content-item-active-color: #ffffff;
  --uv-pagination-content-item-bg-color: #f0f2f5;
  --uv-pagination-content-item-acitve-bg-color: #409eff;
  --uv-pagination-disabled-color: #bbbec4;
  --uv-pagination-text-padding: 0 5px;

Released under the MIT License.