feat: 新增组件预览

This commit is contained in:
MTrun
2022-03-07 12:33:05 +08:00
parent 8aa4490ea9
commit e6a99302d6
32 changed files with 102 additions and 93 deletions
+1 -14
View File
@@ -1,19 +1,6 @@
import { defineAsyncComponent, AsyncComponentLoader } from 'vue'
import { AsyncLoading, AsyncSkeletonLoading } from '@/components/LoadingComponent'
import { ConfigType } from '@/packages/index.d'
import { fetchChartComponent } from '@/packages/index'
/**
* * 预览页面动态注册 package 组件
* @param {ConfigType} dropData
*/
export const componentPackageInstall = async (dropData: Omit<ConfigType, "node">) => {
const key = dropData.key.substring(1)
console.log(window['$vue']);
if (!window['$vue'].component(key)) {
const chart = await fetchChartComponent(dropData)
window['$vue'].component(key, chart)
}
}
/**
* * 动态注册组件
*/