Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/WYuanyang/wxapp-animateNumber
微信小程序--滚动数字
https://github.com/WYuanyang/wxapp-animateNumber
Last synced: 2 months ago
JSON representation
微信小程序--滚动数字
- Host: GitHub
- URL: https://github.com/WYuanyang/wxapp-animateNumber
- Owner: WYuanyang
- Created: 2016-12-26T08:48:56.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-27T02:15:18.000Z (about 8 years ago)
- Last Synced: 2024-08-12T02:01:50.421Z (5 months ago)
- Language: JavaScript
- Size: 8.79 KB
- Stars: 46
- Watchers: 2
- Forks: 36
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- Awesome-Miniprogram - 滚动数字
README
# wxapp-animateNumber
微信小程序--滚动数字
##效果展示
![mahua](http://jsh5css.cn/blog/wp-content/uploads/2016/12/20161226172301_82851.gif)##使用方式
```javascript
// pages/main/index.js
import NumberAnimate from "../../utils/NumberAnimate";
```
```javascript
// pages/main/index.js
let n1 = new NumberAnimate({
from:num1,//开始时的数字
speed:2000,// 总时间
refreshTime:100,// 刷新一次的时间
decimals:3,//小数点后的位数
onUpdate:()=>{//更新回调函数
this.setData({
num1:n1.tempValue
});
},
onComplete:()=>{//完成回调函数
this.setData({
num1Complete:" 完成了"
});
}
});
```
##有问题反馈
在使用中有任何问题,欢迎反馈给我,可以用以下联系方式跟我交流* Email: [email protected]
* QQ: 317147055
* Blog: http://blog.jsh5css.cn