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

电子商务专业有什么用中国seo排行榜

电子商务专业有什么用,中国seo排行榜,市房城乡建设委官网站,购买商标去哪个网站工作中遇到了一个时间正计时的功能。 另外涉及到有Vue父组件调用子组件中的data和method,作为记录。 下面贴代码~ HTML部分 <template><div class"timer"><div ref"startTimer">00:00:00</div></div> </template>JS…

工作中遇到了一个时间正计时的功能。
另外涉及到有Vue父组件调用子组件中的data和method,作为记录。
下面贴代码~

HTML部分

<template><div class="timer"><div ref="startTimer">00:00:00</div></div>
</template>

JS部分


<script>
export default {name:'Timer',props:{time:{type:Number}},data() {return {timer: "",hour: 0,minutes: 0,seconds: 0,cr: ''}},created() {this.timer = setInterval(this.startTimer, 1000);},methods: {startTimer() {this.seconds += 1;if (this.seconds >= 60) {this.seconds = 0;this.minutes = this.minutes + 1;}if (this.minutes >= 60) {this.minutes = 0;this.hour = this.hour + 1;}this.$refs.startTimer.innerHTML = (this.hour < 10 ? '0' + this.hour: this.hour) + ':' + (this.minutes < 10 ? '0' + this.minutes: this.minutes) + ':' + (this.seconds < 10 ? '0' + this.seconds: this.seconds);this.cr =  this.seconds},stop () {clearInterval(this.timer)},start () {this.timer = setInterval(this.startTimer, 1000)}}
}
</script>

这里通过props把父组件的方法传递给子组件

这里我们在子组件中定义

<Time :time="time" ref="headerChild"></Time>

我要调用父组件中的start()的方法以及参数,方法如下

this.$refs.headerChild.stop()
this.$refs.headerChild.seconds

注:子组件中统计时分秒总合

var timeHour = this.$refs.headerChild.hour
var timeMinutes = this.$refs.headerChild.minutes
var timeSeconds = this.$refs.headerChild.seconds
var totalTime = timeHour * 3600 + timeMinutes * 60 + timeSeconds

http://www.dinnco.com/news/41676.html

相关文章:

  • 枣强做百度网站东莞网站推广的公司
  • 怎么做垂直门户网站社群营销活动策划方案
  • 北京十大网站建设公司百度优化
  • 云南专业建网站常州seo外包公司
  • 横岗网站制作搜索引擎营销的原理
  • 企业网站开源代码下载东莞服务好的营销型网站建设
  • 建设网站图片大全seo应用领域有哪些
  • 江苏做网站价格成都十大营销策划公司
  • 张家港英文网站制作app推广活动策划方案
  • 充实网站 廉政建设 板块福州seo公司
  • php网站开发专业是做什么的网络软文推广平台
  • 宝安专业网站设计多少钱seo是什么服务器
  • 湛江做网站推广方案如何写
  • 上海app开发外包旺道seo推广系统怎么收费
  • 网站对位搜索引擎排行榜
  • 内地公司 香港服务器 经营性网站做个网站
  • 做公司网站怎么删除图片北京网站推广营销服务电话
  • 前端网站搜索导航怎么做企业营销模式
  • 用axure做网站首页百度推广登录
  • 通用集团网站模板网站访问量统计工具
  • 怎么做建设网站首页成都企业网站seo技术
  • 做网站后台的时候误删了数据库的表百度代做seo排名
  • 编程网站开发市场营销方案
  • 体育馆做网站公司疫情最新消息今天封城了
  • 旅游去过的地方可做标识网站百度热搜大数据
  • 什么是网络建站seo优化快速排名技术
  • vue做的pc线上网站西安百度seo推广电话
  • 视频付费网站建设关键词批量调词 软件
  • 武汉做网站熊掌号网络优化师
  • 福州做网站多少钱开一个免费网站