0.1.0 • Published 4 years ago

count-flip v0.1.0

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

count-flip

适用于vue的数字滚动动画插件。 Number flip animation for vue.

install(安装)

yarn add count-flip
or
npm install count-flip

import(引入)

import CountFlip from 'count-flip'

Vue.use(CountFlip)

use(使用)

<div class="row">
  <span>带小数点:</span><CountFlip :number="5201314"></CountFlip>
</div>
<div class="row">
  <span>不带小数点:</span><CountFlip :number="5201314" :comma="false"></CountFlip>
</div>
<div class="row">
  <span>自定义字号:</span><CountFlip :number="5201314" :size="50"></CountFlip>
</div>
<div class="row">
  <span>自定义颜色:</span><CountFlip :number="5201314" color="#ff6600"></CountFlip>
</div>
<div class="row">
  <span>动态切换数值:</span><CountFlip :number="number" color="#ff6600"></CountFlip>
  <button @click="change">切换数字</button>
</div>

props(参数)

proptypedefaultdescribe
numberNumber0The number should be showed
commaBooleantrueIf need currency format or not,like 123,456
sizeNumber24The size of font
colorString#000The color of font

screenshot(截图)

npm.io