From 87eb5fe6648e8a2a50c8f5d1d3fd4d94a087f094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=87=E6=B7=BC=EF=BC=88piexlmax?= <303176530@qq.com> Date: Sun, 26 Sep 2021 11:37:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E7=94=9F=E5=91=BD=E5=91=A8?= =?UTF-8?q?=E6=9C=9F=E9=92=A9=E5=AD=90=EF=BC=8C=E5=B0=86`beforeDestroy`?= =?UTF-8?q?=E6=9B=B4=E6=94=B9=E4=B8=BA`beforeUnmount`=20(#738)=20(#742)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化将beforeDestroy更改为beforeUnmount --- web/src/view/dashboard/dashbordCharts/echartsLine.vue | 2 +- web/src/view/layout/aside/historyComponent/history.vue | 2 +- web/src/view/layout/aside/index.vue | 2 +- web/src/view/layout/screenfull/index.vue | 2 +- web/src/view/system/state.vue | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/web/src/view/dashboard/dashbordCharts/echartsLine.vue b/web/src/view/dashboard/dashbordCharts/echartsLine.vue index c9a3ecfc..6e2f5055 100644 --- a/web/src/view/dashboard/dashbordCharts/echartsLine.vue +++ b/web/src/view/dashboard/dashbordCharts/echartsLine.vue @@ -51,7 +51,7 @@ export default { this.initChart() }) }, - beforeDestroy() { + beforeUnmount() { if (!this.chart) { return } diff --git a/web/src/view/layout/aside/historyComponent/history.vue b/web/src/view/layout/aside/historyComponent/history.vue index 6dfc2dcc..f1b59df8 100644 --- a/web/src/view/layout/aside/historyComponent/history.vue +++ b/web/src/view/layout/aside/historyComponent/history.vue @@ -120,7 +120,7 @@ export default { } this.setTab(this.$route) }, - beforeDestroy() { + beforeUnmount() { emitter.off('collapse') emitter.off('mobile') }, diff --git a/web/src/view/layout/aside/index.vue b/web/src/view/layout/aside/index.vue index bdc451f5..a24fb71e 100644 --- a/web/src/view/layout/aside/index.vue +++ b/web/src/view/layout/aside/index.vue @@ -58,7 +58,7 @@ export default { this.isCollapse = item }) }, - beforeDestroy() { + beforeUnmount() { emitter.off('collapse') }, methods: { diff --git a/web/src/view/layout/screenfull/index.vue b/web/src/view/layout/screenfull/index.vue index e422ee5a..73176486 100644 --- a/web/src/view/layout/screenfull/index.vue +++ b/web/src/view/layout/screenfull/index.vue @@ -90,7 +90,7 @@ export default { screenfull.on('change', this.changeFullShow) } }, - destroyed() { + unmounted() { screenfull.off('change', this.changeFullShow) }, methods: { diff --git a/web/src/view/system/state.vue b/web/src/view/system/state.vue index a7c08bf4..466f13b7 100644 --- a/web/src/view/system/state.vue +++ b/web/src/view/system/state.vue @@ -159,7 +159,7 @@ export default { this.reload() }, 1000 * 10) }, - beforeDestroy() { + beforeUnmount() { clearInterval(this.timer) this.timer = null },