mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
feat: 新增组件预览
This commit is contained in:
+1
-14
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* * 动态注册组件
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user