更新记录
1.0.0(2023-02-21)
下载此版本
第一版发布
平台兼容性
uni-app
Vue2 |
Vue3 |
Chrome |
Safari |
app-vue |
app-nvue |
Android |
iOS |
鸿蒙 |
√ |
√ |
√ |
√ |
- |
- |
- |
- |
- |
微信小程序 |
支付宝小程序 |
抖音小程序 |
百度小程序 |
快手小程序 |
京东小程序 |
鸿蒙元服务 |
QQ小程序 |
飞书小程序 |
快应用-华为 |
快应用-联盟 |
√ |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
其他
tyz-number-animation 数值滚动
使用示例
<template>
<view>
<tyzNumberAnimation ref="tyz" :from="0" :to="100" :precision="0" :duration="2000"
@onFinish="onFinish"></tyzNumberAnimation>
<button @click="start">点击第一个开始</button>
<tyzNumberAnimation style="font-size: 50px;" :active="true" :from="0" :to="100" :precision="1" :duration="5000"
@onFinish="onFinish"></tyzNumberAnimation>
</view>
</template>
<script>
import tyzNumberAnimation
from '../../uni_modules/tyz-number-animation/components/tyz-number-animation/tyz-number-animation.vue'
export default {
components: {
tyzNumberAnimation
},
methods: {
onFinish() {
uni.showToast({
title: "完成的回调",
icon: "none"
})
},
start() {
this.$refs.tyz.play()
}
}
}
</script>
API
tyzNumberAnimation Props
名称 |
类型 |
默认参数 |
说明 |
to |
Number |
0 |
开始数值 |
from |
Number |
0 |
结束数值 |
duration |
Number |
2000 |
时长 |
fontSize |
Number |
14 |
字体大小 |
precision |
Number |
0 |
精度,保留小数点后几位 |
fontFamily |
string |
undefined |
字体族 |
active |
Boolean |
false |
是否开始动画 |
on-finish |
() => void |
undefined |
动画结束的回调 |
tyzNumberAnimation Methods