Skip to content

Commit

Permalink
docs: update faq013.md
Browse files Browse the repository at this point in the history
  • Loading branch information
liujuping authored Aug 17, 2023
1 parent a389ec1 commit e111a0f
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions docs/docs/faq/faq013.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,28 @@ tags: [FAQ]
## 处理方式
### 【推荐】升级到 Engine Verison 1.0.11 以上
### 新增 save propsReducer
通过新增 Save 态的 propsReducer,将 hidden props 去掉。
参考:
[https://github.com/alibaba/lowcode-demo/blob/main/src/sample-plugins/delete-hidden-transducer/index.ts](https://github.com/alibaba/lowcode-demo/blob/main/src/sample-plugins/delete-hidden-transducer/index.ts)

通过新增 Save 态的 propsReducer,将 hidden props 去掉。可以参考下面的代码:

```typescript
import { project } from '@alilc/lowcode-engine';
import { IPublicEnumTransformStage } from '@alilc/lowcode-types';

export const deleteHiddenTransducer = (ctx: any) => {
return {
name: 'deleteHiddenTransducer',
async init() {
project.addPropsTransducer((props: any): any => {
delete props.hidden;
return props;
}, IPublicEnumTransformStage.Save);
},
};
}

deleteHiddenTransducer.pluginName = 'deleteHiddenTransducer';

```

### 导出 schema 使用 Save 态
```typescript
Expand Down

0 comments on commit e111a0f

Please sign in to comment.