fix: 提交动态注册的代码

This commit is contained in:
mtruning
2022-03-06 21:26:31 +08:00
parent e3816524da
commit a451faad77
5 changed files with 34 additions and 6 deletions
@@ -22,7 +22,7 @@
<script setup lang="ts">
import { PropType } from 'vue'
import { MacOsControlBtn } from '@/components/MacOsControlBtn/index'
import { requireErrorImg, componentInstall } from '@/utils'
import { componentInstall } from '@/utils'
import { DragKeyEnum } from '@/enums/editPageEnum'
import { ConfigType } from '@/packages/index.d'
import omit from 'lodash/omit'
@@ -19,6 +19,8 @@ import { PropType, computed } from 'vue'
import { ChartEditStorageType } from '../../index.d'
import { chartColors } from '@/settings/chartThemes/index'
import { useSizeStyle, useComponentStyle } from '../../hooks/useStyle.hook'
import { componentPackageInstall } from '@/utils'
import { CreateComponentType } from '@/packages/index.d'
const props = defineProps({
localStorageInfo: {
@@ -27,6 +29,11 @@ const props = defineProps({
}
})
// 动态注册
props.localStorageInfo.componentList.forEach((e: CreateComponentType) => {
componentPackageInstall(e.chartConfig)
});
// 主题色
const themeSetting = computed(() => {
const chartThemeSetting = props.localStorageInfo.editCanvasConfig.chartThemeSetting
+1 -2
View File
@@ -18,7 +18,6 @@ import { getLocalStorage, fetchRouteParams } from '@/utils'
import { StorageEnum } from '@/enums/storageEnum'
import { RenderList } from './components/RenderList/index'
import { ChartEditStorageType } from './index.d'
import { useSizeStyle } from './hooks/useStyle.hook'
const previewRef = ref()
@@ -55,7 +54,7 @@ const previewRefStyle = computed(() => {
if (!localStorageInfo) {
window['$message'].warning('获取数据失败')
}
console.log(localStorageInfo);
nextTick(() => {
const { calcRate, windowResize, unWindowResize } = usePreviewScale(width.value as number, height.value as number, previewRef.value)