feat(material): material apis add refreshComponentMetasMap function

This commit is contained in:
liujuping 2023-04-18 11:50:23 +08:00 committed by 林熠
parent 2c38c5d9a0
commit aef10fca0d
3 changed files with 25 additions and 2 deletions

View File

@ -245,6 +245,7 @@ material.getComponentMeta('Input');
``` ```
#### getComponentMetasMap #### getComponentMetasMap
获取所有已注册的物料元数据 获取所有已注册的物料元数据
```typescript ```typescript
@ -264,6 +265,15 @@ import { material } from '@alilc/lowcode-engine';
material.getComponentMetasMap(); material.getComponentMetasMap();
``` ```
#### refreshComponentMetasMap
刷新 componentMetasMap可触发模拟器里的 components 重新构建
**@since v1.1.7**
```typescript
refreshComponentMetasMap(): void;
```
### 物料元数据管道函数 ### 物料元数据管道函数
#### registerMetadataTransducer #### registerMetadataTransducer

View File

@ -143,9 +143,16 @@ export class Material implements IPublicApiMaterial {
* action * action
* @param action * @param action
*/ */
addBuiltinComponentAction(action: IPublicTypeComponentAction) { addBuiltinComponentAction = (action: IPublicTypeComponentAction) => {
this[designerSymbol].componentActions.addBuiltinComponentAction(action); this[designerSymbol].componentActions.addBuiltinComponentAction(action);
} };
/**
* componentMetasMap components
*/
refreshComponentMetasMap = () => {
this[designerSymbol].refreshComponentMetasMap();
};
/** /**
* action * action

View File

@ -122,4 +122,10 @@ export interface IPublicApiMaterial {
* @param fn * @param fn
*/ */
onChangeAssets(fn: () => void): IPublicTypeDisposable; onChangeAssets(fn: () => void): IPublicTypeDisposable;
/**
* componentMetasMap components
* @since v1.1.7
*/
refreshComponentMetasMap(): void;
} }