Commit 04ad1060 authored by leon's avatar leon

fix: realTime component add create

parent ecdd5c23
<template>
<view>
<div class="timer">
<NormalTitle :elementInfo="elementInfo"></NormalTitle>
<div :style="{
'font-size':`${elementInfo.option.time.textStyle.fontSize}px`,
'color': elementInfo.option.time.textStyle.color,
'font-weight': elementInfo.option.time.textStyle.fontWeight,
'text-align': elementInfo.option.time.left,
}">
{{ realTime }}
</div>
<view class="timer">
<NormalTitle :elementInfo="elementInfo"></NormalTitle>
<div :style="{
'font-size':`${elementInfo.option.time.textStyle.fontSize}px`,
'color': elementInfo.option.time.textStyle.color,
'font-weight': elementInfo.option.time.textStyle.fontWeight,
'text-align': elementInfo.option.time.left,
}">
{{ realTime }}
</div>
</view>
</template>
......@@ -25,13 +23,15 @@
realTime: '',
timer: null
};
},
created() {
this.initChart()
},
onUnLoad() {
destroyed() {
clearInterval(this.timer)
},
methods: {
initChart() {
initChart() {
this.timer = setInterval(() => {
const timestamp = new Date().getTime()
this.realTime = this.$u.timeFormat(timestamp, this.getDateFormat())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment