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() {