From 2554614eef1498331508330d29522a3737c82a04 Mon Sep 17 00:00:00 2001 From: dataeaseShu <106045316+dataeaseShu@users.noreply.github.com> Date: Wed, 5 Jul 2023 11:53:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=AC=A6=E5=8F=B7=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E5=86=85=E5=AD=98=E6=B3=84=E6=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/asyncComponent/index.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/asyncComponent/index.vue b/frontend/src/components/asyncComponent/index.vue index 553188bcd8..caa85d89e0 100644 --- a/frontend/src/components/asyncComponent/index.vue +++ b/frontend/src/components/asyncComponent/index.vue @@ -47,13 +47,15 @@ export default { // window.SyncComponentCache[this.url] = Axios.get(this.url) res = await window.SyncComponentCache[this.url] } else { - res = await window.SyncComponentCache[this.url] + this.mode = await window.SyncComponentCache[this.url] + return } if (res) { const Fn = Function const dynamicCode = res.data || res const component = new Fn(`return ${dynamicCode}`)() this.mode = component.default || component + window.SyncComponentCache[this.url] = this.mode } } } @@ -61,6 +63,9 @@ export default { created() { this.refId = uuid.v1 }, + beforeDestroy() { + this.mode = null + }, methods: { /* chartResize() { this.$refs[this.refId] && this.$refs[this.refId].chartResize && this.$refs[this.refId].chartResize()