Skip to content

Commit fceffce

Browse files
zude.hzdliujuping
authored andcommitted
feat: 新增render notFoundComponent、faultComponent engineConfig配置
1 parent 73acf6f commit fceffce

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

packages/designer/src/builtin-simulator/host.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,14 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
258258
return engineConfig.get('enableStrictNotFoundMode') ?? false;
259259
}
260260

261+
get notFoundComponent(): any {
262+
return engineConfig.get('notFoundComponent') ?? null;
263+
}
264+
265+
get faultComponent(): any {
266+
return engineConfig.get('faultComponent') ?? null;
267+
}
268+
261269
@computed get componentsAsset(): Asset | undefined {
262270
return this.get('componentsAsset');
263271
}

packages/react-simulator-renderer/src/renderer-view.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ class Renderer extends Component<{
188188
getNode={(id: string) => documentInstance.getNode(id) as Node}
189189
rendererName="PageRenderer"
190190
thisRequiredInJSE={host.thisRequiredInJSE}
191+
notFoundComponent={host.notFoundComponent}
192+
faultComponent={host.faultComponent}
191193
customCreateElement={(Component: any, props: any, children: any) => {
192194
const { __id, ...viewProps } = props;
193195
viewProps.componentId = __id;

0 commit comments

Comments
 (0)