fix: 修改预览页面的报错问题

This commit is contained in:
奔跑的面条
2022-11-05 21:31:42 +08:00
parent c35dd6fad9
commit 32762aa8a7
3 changed files with 10 additions and 8 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
<template>
<Preview :key="key"></Preview>
<preview :key="key"></preview>
</template>
<script setup lang="ts">
@@ -16,10 +16,10 @@ let localStorageInfo: ChartEditStorageType = getSessionStorageInfo() as ChartEdi
// 数据变更 -> 同步sessionStorage -> reload页面 (重新执行Mounted
;[SavePageEnum.JSON, SavePageEnum.CHART].forEach((saveEvent: string) => {
opener.addEventListener(saveEvent, (e: any) => {
if (!window.opener) return
window.opener.addEventListener(saveEvent, (e: any) => {
setSessionStorage(StorageEnum.GO_CHART_STORAGE_LIST, [{ ...e.detail, id: localStorageInfo.id }])
key.value = Date.now()
})
})
</script>