uni-app小程序24小时倒计时

 时间:2026-04-23 10:07:23

1、<template>

  <view>{{countdown}}</view>

</template>

2、<script>

export default {

data() {

h:23,//时

m:59,//分

s:59,//秒

countdown:'24:00:00',//倒计时

timer:null,//重复执行

};

};

</script>

3、onLoad(){

this.timer = setInterval(()=>{

   this.timeCount()

},1000)

},

4、methods: {

timeCount(){

--this.s;

if(this.s<0){

--this.m;

this.s=59;

}

    if(this.m<0){

--this.h;

this.m=59

}

if(this.h<0){

this.s=0;

this.m=0;

}

this.countdown = this.h+":"+this.m+":"+this.s

},

}

  • 剪映如何添加庞门体字体
  • Mac苹果电脑怎么下载b站视频
  • Procrate 怎么快速便捷的复制图层?
  • ffmpeg去除视频中的logo水印和字幕
  • 今日头条如何上传素材
  • 热门搜索
    上海旅游人力资源网 秦皇岛旅游 四川稻城亚丁旅游攻略 鄯善旅游 涞源旅游 旅游毕业论文 青岛旅游观光塔 沙滩旅游 全国旅游路线 浙江天台山旅游攻略