fix: comp which has no npm info should be regarded as lowCode comp

This commit is contained in:
LeoYuan 袁力皓 2023-05-26 14:20:14 +08:00 committed by 刘菊萍(絮黎)
parent 2004350c0d
commit ecca076d50

View File

@ -839,13 +839,18 @@ export class DocumentModel implements IDocumentModel {
} }
// 合并外界传入的自定义渲染的组件 // 合并外界传入的自定义渲染的组件
if (Array.isArray(extraComps)) { if (Array.isArray(extraComps)) {
extraComps.forEach(c => { extraComps.forEach((componentName) => {
if (c && !exsitingMap[c]) { if (componentName && !exsitingMap[componentName]) {
const m = this.getComponentMeta(c); const meta = this.getComponentMeta(componentName);
if (m && m.npm?.package) { if (meta?.npm?.package) {
componentsMap.push({ componentsMap.push({
...m?.npm, ...meta?.npm,
componentName: c, componentName,
});
} else {
componentsMap.push({
devMode: 'lowCode',
componentName,
}); });
} }
} }