From 67c28460a9868e17d14c16f713def9d4f9835a02 Mon Sep 17 00:00:00 2001 From: yiming Date: Mon, 14 Nov 2022 14:02:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E8=AE=BF=E9=97=AE=E5=AE=9E?= =?UTF-8?q?=E6=97=B6=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/checkMonitoring/index.vue | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/views/checkMonitoring/index.vue b/src/views/checkMonitoring/index.vue index af88298..b80faa7 100644 --- a/src/views/checkMonitoring/index.vue +++ b/src/views/checkMonitoring/index.vue @@ -151,6 +151,30 @@ export default { }, mounted() { this.request(); + this.$nextTick(() => { + this.getRealTimeCheck(); + }) + this.$on('hook:activated', () => { + this.timer = window.setInterval(this.getRealTimeCheck, 3000); + }) + this.timer = window.setInterval(this.getRealTimeCheck, 3000); + + this.$on('hook:deactivated', () => { + clearInterval(this.timer) + this.timer = null + }) + }, + beforeDestroy() { + console.log("beforeDestroy") + window.clearInterval(this.timer); + this.timer = null; + }, + created() { + + }, + destroyed() { + window.clearInterval(this.timer); + this.timer = null; }, methods: { request() {