Showing
1 changed file
with
7 additions
and
1 deletions
... | ... | @@ -35,7 +35,7 @@ import { NEmpty, NCard, NForm, NFormItem, NInput, NButton, NInputGroup } from 'n |
35 | 35 | import { getSessionStorageInfo } from '../preview/utils' |
36 | 36 | import type { ChartEditStorageType } from '../preview/index.d' |
37 | 37 | import { SavePageEnum } from '@/enums/editPageEnum' |
38 | -import { JSONParse, setSessionStorage, setTitle } from '@/utils' | |
38 | +import { componentInstall, JSONParse, setSessionStorage, setTitle } from '@/utils' | |
39 | 39 | import { StorageEnum } from '@/enums/storageEnum' |
40 | 40 | import { onMounted, ref, unref } from 'vue' |
41 | 41 | import Preview from '../preview/index.vue' |
... | ... | @@ -43,6 +43,7 @@ import { useRoute } from 'vue-router' |
43 | 43 | import { useUserStore } from '@/store/external/modules/user' |
44 | 44 | import { checkSharePageNeedAccessToken, getPublicToken, getShareContentData } from '@/api/external/sys/share' |
45 | 45 | import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' |
46 | +import { fetchChartComponent } from '@/packages' | |
46 | 47 | |
47 | 48 | const allowLoadPreviewPage = ref(true) |
48 | 49 | const showModal = ref(false) |
... | ... | @@ -92,6 +93,11 @@ const getSharePageContentData = async () => { |
92 | 93 | chartEditStore.editCanvasConfig = editCanvasConfig |
93 | 94 | chartEditStore.requestGlobalConfig = requestGlobalConfig |
94 | 95 | chartEditStore.componentList = componentList |
96 | + | |
97 | + // register 组件 | |
98 | + componentList.forEach(item => { | |
99 | + componentInstall(item.chartConfig.chartKey, fetchChartComponent(item.chartConfig)) | |
100 | + }) | |
95 | 101 | } |
96 | 102 | setTitle(dataViewName || '') |
97 | 103 | showModal.value = false | ... | ... |