Skip to content

naokimidori/mini-number-counter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

mini-number-counter

关于

mini-number-counter 是一个适用于小程序的数字滚动效果的插件。

使用说明

npm install mini-number-counter --save
import numberCounter from 'mini-number-counter';

Page({
  data: {
    num: 0,
  },
  onLoad: function () {
    const num_obj = new numberCounter({
      from: 12.45,
      target: 38.88,
      speed: 1500,
      refreshTime: 100,
      decimals: 2,
      onUpdate:() => {
        this.setData({
          num: num_obj.temp,
        });
      },
      onComplete: function() {},
    });
  },
})

License

Releasing under the MIT License.

About

number counter animate library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published