Ver Fonte

fix: 修改类型错误的问题

奔跑的面条 há 3 anos atrás
pai
commit
b26a45a7b6

+ 1 - 1
src/views/edit/index.vue

@@ -48,7 +48,7 @@ let content = ref('')
 
 // 从sessionStorage 获取数据
 function getDataBySession() {
-  const localStorageInfo: ChartEditStorageType = getSessionStorageInfo() as ChartEditStorageType
+  const localStorageInfo: ChartEditStorageType = getSessionStorageInfo() as unknown as ChartEditStorageType
   content.value = JSON.stringify(localStorageInfo, undefined, 2)
 }
 getDataBySession()

+ 1 - 1
src/views/preview/suspenseIndex.vue

@@ -49,7 +49,7 @@ const storageList: ChartEditStorageType[] = getSessionStorage(
   StorageEnum.GO_CHART_STORAGE_LIST
 )
 
-const localStorageInfo = await getSessionStorageInfo() as ChartEditStorageType
+const localStorageInfo = await getSessionStorageInfo() as unknown as ChartEditStorageType
 
 // @ts-ignore
 if(localStorageInfo.isRelease === false) {

+ 1 - 1
src/views/preview/wrapper.vue

@@ -12,7 +12,7 @@ import { ref } from 'vue'
 import Preview from './index.vue'
 
 let key = ref(Date.now())
-let localStorageInfo: ChartEditStorageType = getSessionStorageInfo() as ChartEditStorageType
+let localStorageInfo: ChartEditStorageType = getSessionStorageInfo() as unknown as ChartEditStorageType
 
 // 数据变更 -> 同步sessionStorage -> reload页面 (重新执行Mounted)
 ;[SavePageEnum.JSON, SavePageEnum.CHART].forEach((saveEvent: string) => {