From ea179f98971e70361e274ef333dcdfa50ec9f7c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A9=BA?= Date: Fri, 15 Sep 2023 14:12:28 +0000 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E5=BA=94=E7=94=A8op?= =?UTF-8?q?en=E9=A2=84=E8=A7=88=E5=9C=B0=E5=9D=80=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=EF=BC=8C=E5=8F=91=E7=8E=B0window.opener=E5=B9=B6?= =?UTF-8?q?=E4=B8=8D=E6=98=AF=E4=B8=80=E4=B8=AAwindow=E5=AF=B9=E8=B1=A1?= =?UTF-8?q?=E4=BC=9A=E6=8A=A5addEventListener=E4=B8=8D=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E3=80=82=20=E7=AC=AC=E4=B8=89=E6=96=B9=E5=BA=94=E7=94=A8open?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E5=9C=B0=E5=9D=80=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=EF=BC=8C=E5=8F=91=E7=8E=B0window.opener=E5=B9=B6=E4=B8=8D?= =?UTF-8?q?=E6=98=AF=E4=B8=80=E4=B8=AAwindow=E5=AF=B9=E8=B1=A1=E4=BC=9A?= =?UTF-8?q?=E6=8A=A5addEventListener=E4=B8=8D=E5=AD=98=E5=9C=A8=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 空 --- src/views/preview/wrapper.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/views/preview/wrapper.vue b/src/views/preview/wrapper.vue index c119a661..6a9b9a72 100644 --- a/src/views/preview/wrapper.vue +++ b/src/views/preview/wrapper.vue @@ -16,6 +16,7 @@ let key = ref(Date.now()) // 数据变更 -> 组件销毁重建 ;[SavePageEnum.JSON, SavePageEnum.CHART_TO_PREVIEW].forEach((saveEvent: string) => { if (!window.opener) return + if(!(window.opener === window)) return window.opener.addEventListener(saveEvent, async (e: any) => { const localStorageInfo: ChartEditStorageType = await getSessionStorageInfo() as unknown as ChartEditStorageType setSessionStorage(StorageEnum.GO_CHART_STORAGE_LIST, [{ ...e.detail, id: localStorageInfo.id }])