feat: 动态注册组件,优化首页出现性能

This commit is contained in:
MTrun
2022-02-25 22:10:18 +08:00
parent 211e7b08c4
commit f8095ca52a
5 changed files with 18 additions and 16 deletions
+1 -11
View File
@@ -17,16 +17,6 @@ let packagesList: PackagesType = {
[PackagesCategoryEnum.DECORATES]: DecorateList
}
// * 注册
const packagesInstall = (app: App): void => {
for (const item in packagesList) {
const chartList: ConfigType[] = (packagesList as any)[item]
chartList.forEach((chart: ConfigType) => {
app.component(chart.key, chart.node)
})
}
}
/**
* * 获取目标拖拽组件信息
* @param dropData
@@ -38,4 +28,4 @@ const createComponent = async (dropData: ConfigType) => {
return new chart.default()
}
export { packagesList, packagesInstall, createComponent }
export { packagesList, createComponent }