更新记录
1.0.0(2023-05-15)
下载此版本
第一次上线
平台兼容性
uni-app
Vue2 |
Vue3 |
Chrome |
Safari |
app-vue |
app-nvue |
Android |
iOS |
鸿蒙 |
√ |
- |
- |
- |
- |
- |
- |
- |
- |
微信小程序 |
支付宝小程序 |
抖音小程序 |
百度小程序 |
快手小程序 |
京东小程序 |
鸿蒙元服务 |
QQ小程序 |
飞书小程序 |
快应用-华为 |
快应用-联盟 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
一、使用
<count-down
:time="dateTime"
format="DD:HH:mm:ss"
autoStart
@change="onChange"
@finish="onFinish"
>
<view class="time">
<view class="time__item">{{ timeData.days }} 天</view>
<view class="time__item">{{ timeData.hours}} 时</view>
<view class="time__item">{{ timeData.minutes }} 分</view>
<view class="time__item">{{ timeData.seconds }} 秒</view>
</view>
</count-down>
<script>
import countDown from '@/components/count-down'
export default {
components:{
countDown
},
data() {
return {
timeData:{},
dateTime:5000,
}
},
methods: {
onChange( e ){
this.timeData = e;
},
onFinish(){
console.log('倒计时结束');
},
}
}
</script>
二、属性
属性名 |
说明 |
类型 |
time |
倒计时时长,单位ms |
Number/String |
format |
时间格式,DD-日,HH-时,mm-分,ss-秒 |
String |
autoStart |
是否自动开始倒计时 , Boolean |
Boolean |
change |
正在倒计时 |
Function |
finish |
倒计时结束 |
Function |