当前位置: 首页 > news >正文

网站建设流程王晴儿百度关键词优化查询

网站建设流程王晴儿,百度关键词优化查询,wordpress显示作者墙,怎么开始做网站使用定时器的规避方法 为了避免定时器误差导致倒计时计算错误,可以采用一些规避方法,比如将倒计时被中断时的剩余时间记录下来,重新开启定时器时再将这个剩余时间加到新的计算中。同时,为了避免定时器延迟,可以在每次执…

使用定时器的规避方法
为了避免定时器误差导致倒计时计算错误,可以采用一些规避方法,比如将倒计时被中断时的剩余时间记录下来,重新开启定时器时再将这个剩余时间加到新的计算中。同时,为了避免定时器延迟,可以在每次执行回调函数时,记录当前时间戳,再计算与上一次执行回调函数的时间差,来调整倒计时的时间。
在这里插入图片描述

1.子组件<template><view class="time"><view class="red-box" >{{days>=10?days:'0'+days}}</view><view class="fz-12 color3" style="margin: 0 2px;"></view><view class="red-box" >{{hours>=10?hours:'0'+hours}}</view><view class="fz-12 color3" style="margin: 0 2px;"></view><view class="red-box">{{minutes>=10?minutes:'0'+minutes}}</view><view class="fz-12 color3" style="margin: 0 2px;"></view><view class="red-box">{{seconds>=10?seconds:'0'+seconds}}</view><view class="fz-12 color3" style="margin: 0 2px;"></view></view>
</template><script>export default {props: {targetDate: {type: String,required: true}},data() {return {countdownInterval: null,days: 0,hours: 0,minutes: 0,seconds: 0};},mounted() {this.startCountdown();},beforeDestroy() {clearInterval(this.countdownInterval);},methods: {startCountdown() {this.updateCountdown(); // 先立即更新一次this.countdownInterval = setInterval(() => {this.updateCountdown();}, 1000);},updateCountdown() {const now = new Date();const target = new Date(this.targetDate);const duration = Math.max(0, target - now) / 1000;this.days = Math.floor(duration / 86400);this.hours = Math.floor((duration % 86400) / 3600);this.minutes = Math.floor((duration % 3600) / 60);this.seconds = Math.floor(duration % 60);if (duration <= 0) {clearInterval(this.countdownInterval);this.$emit('countdownFinished'); // 触发倒计时结束事件}}}};
</script>
<style lang="scss" scoped>.time {margin-top: 4rpx;display: flex;color: #ff0000;font-size: 22rpx;text-align: center;align-items: center;.red-box {font-size: 22rpx;}}.color3{color: #ff0000;font-size: 22rpx;}
</style>
http://www.hkea.cn/news/289545/

相关文章:

  • 成交功能网站怎么推广自己的产品
  • 北京宣传片网站seo综合查询
  • 滨海网站建设公司百度指数的使用
  • 湛江网站建设外包seo到底是什么
  • 做收集信息的网站河源市企业网站seo价格
  • 有赞短链接生成汕头seo推广
  • 团队做网站分工搜索引擎案例分析结论
  • 企业网站的建设过程做整站优化
  • 最简单的cms网站怎么做惠州抖音seo
  • 做网站销售怎么开发客户自己做一个网站
  • wordpress发布文章空白整站优化 mail
  • vs怎么做网站的首页seo知识培训
  • 网站建设的一般步骤包括知乎关键词排名工具
  • 网页设计怎样做一个网页seo软件哪个好
  • 销售性网站建设需求seo案例
  • 企业怎样选择域名做网站电脑突然多了windows优化大师
  • 网站一元空间有哪些呀品牌策划方案范文
  • 最便宜的网站建设企点
  • 网站代码加密深圳新闻今日最新
  • 不要钱做网站软件网站seo优化效果
  • 公司做网站提供产品加盟费互联网销售怎么做
  • 视频网站开发架构百度app最新版本
  • 网站上内容列表怎么做的网站模板中心
  • 上海利恩建设集团有限公司网站国内好用的搜索引擎
  • 网站模板论坛今日重大军事新闻
  • 昆山自适应网站建设电商平台的营销方式
  • 盘龙区网站建设外包高级搜索引擎技巧
  • 什么做的网站吗58百度搜索引擎
  • wordpress 企业站开发口碑营销的概念
  • 广州免费核酸检测点东莞seo项目优化方法