feat: 合并标题名称功能, 解决冲突

This commit is contained in:
奔跑的面条
2023-01-09 20:18:27 +08:00
6 changed files with 27 additions and 8 deletions
+4 -3
View File
@@ -26,7 +26,7 @@
lineNumbers: 'on',
minimap: { enabled: true }
}"
/>
/>
</n-layout-content>
</n-layout>
</div>
@@ -38,7 +38,7 @@ import { MonacoEditor } from '@/components/Pages/MonacoEditor'
import { SavePageEnum } from '@/enums/editPageEnum'
import { getSessionStorageInfo } from '../preview/utils'
import type { ChartEditStorageType } from '../preview/index.d'
import { setSessionStorage, fetchRouteParamsLocation, JSONStringify, JSONParse } from '@/utils'
import { setSessionStorage, fetchRouteParamsLocation, JSONStringify, JSONParse, setTitle } from '@/utils'
import { StorageEnum } from '@/enums/storageEnum'
import { icon } from '@/plugins'
import { useSync } from '@/views/chart/hooks/useSync.hook'
@@ -51,7 +51,8 @@ const showOpenFilePicker: Function = (window as any).showOpenFilePicker
const content = ref('')
// 从sessionStorage 获取数据
async function getDataBySession() {
const localStorageInfo: ChartEditStorageType = await getSessionStorageInfo() as unknown as ChartEditStorageType
const localStorageInfo: ChartEditStorageType = (await getSessionStorageInfo()) as unknown as ChartEditStorageType
setTitle(`编辑-${localStorageInfo.editCanvasConfig.projectName}`)
content.value = JSONStringify(localStorageInfo)
}
setTimeout(getDataBySession)