-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
完善“物料出现 Component Not Found 相关报错” FAQ
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,28 @@ AliLowCodeEngine.project.simulator.renderer.components | |
``` | ||
看看对应的物料是否存在,如果不存在,排查物料问题。 | ||
|
||
如果不正常,查看资产包配置,其中资产包中的 `components` 和 `material.componentsMap` 生成有关系。 | ||
|
||
例如,物料配置信息在 @alilc/lowcode-materials 包里面,即需要在 components 中加上下面的代码 | ||
|
||
```javascript | ||
"components": [{ | ||
"exportName": "AlilcLowcodeMaterialsMeta", | ||
"npm": { | ||
"package": "@alilc/lowcode-materials" | ||
}, | ||
"url": "https://alifd.alicdn.com/npm/@alilc/[email protected]/build/lowcode/meta.js", | ||
"urls": { | ||
"default": "https://alifd.alicdn.com/npm/@alilc/[email protected]/build/lowcode/meta.js", | ||
"design": "https://alifd.alicdn.com/npm/@alilc/[email protected]/build/lowcode/meta.design.js" | ||
} | ||
}] | ||
``` | ||
|
||
`material.componentsMap` 不存在相关的组件信息,原因有两个: | ||
- 没有添加对应的物料到 components 字段中 | ||
- components 配置不正确,需要查看 url 是否正常加载,查看 exportName 是否配置正确,即 `window.${exportName}` 是否存在。 | ||
|
||
2.选中组件,在控制台中输入 | ||
```json | ||
AliLowCodeEngine.project.currentDocument.selection.getNodes()[0].exportSchema('render') | ||
|