From ac57bbedb9667aa3ae4b2b074c56e1344f550ee9 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 10 Jun 2018 08:03:02 +0900 Subject: [PATCH] :v: --- src/client/app/common/views/components/time.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/client/app/common/views/components/time.vue b/src/client/app/common/views/components/time.vue index aebfb3389..700643ff0 100644 --- a/src/client/app/common/views/components/time.vue +++ b/src/client/app/common/views/components/time.vue @@ -58,18 +58,21 @@ export default Vue.extend({ }, created() { if (this.mode == 'relative' || this.mode == 'detail') { - this.tick(); - this.tickId = setInterval(this.tick, 10000); + this.tickId = window.requestAnimationFrame(this.tick); } }, destroyed() { if (this.mode === 'relative' || this.mode === 'detail') { - clearInterval(this.tickId); + window.clearTimeout(this.tickId); } }, methods: { tick() { this.now = new Date(); + + this.tickId = setTimeout(() => { + window.requestAnimationFrame(this.tick); + }, 10000); } } });