refactor: 及时清理模版缓存

This commit is contained in:
wangjiahao 2023-12-05 13:23:02 +08:00
parent a94bac0dd5
commit 47d5546395
2 changed files with 2 additions and 0 deletions

View File

@ -71,6 +71,7 @@ onMounted(() => {
if (createType === 'template') {
const deTemplateDataStr = wsCache.get(`de-template-data`)
const deTemplateData = JSON.parse(deTemplateDataStr)
wsCache.delete('de-template-data')
dvMainStore.setComponentData(JSON.parse(deTemplateData['componentData']))
dvMainStore.setCanvasStyle(JSON.parse(deTemplateData['canvasStyleData']))
dvMainStore.setCanvasViewInfo(deTemplateData['canvasViewInfo'])

View File

@ -201,6 +201,7 @@ onMounted(() => {
//
if (createType === 'template') {
const deTemplateDataStr = wsCache.get(`de-template-data`)
wsCache.delete('de-template-data')
const deTemplateData = JSON.parse(deTemplateDataStr)
dvMainStore.setComponentData(JSON.parse(deTemplateData['componentData']))
dvMainStore.setCanvasStyle(JSON.parse(deTemplateData['canvasStyleData']))