feat: add renderer rendererName prop

This commit is contained in:
liujuping.liujupin 2021-10-12 15:20:00 +08:00
parent 10371f7694
commit 336cb8104e
5 changed files with 5 additions and 0 deletions

View File

@ -211,6 +211,7 @@ class Renderer extends Component<{
}}
documentId={document.id}
getNode={(id: string) => documentInstance.getNode(id) as any}
rendererName="PageRenderer"
customCreateElement={(Component: any, props: any, children: any) => {
const { __id, ...viewProps } = props;
viewProps.componentId = __id;

View File

@ -525,6 +525,7 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
designMode: renderer.designMode,
device: renderer.device,
appHelper: renderer.context,
rendererName: 'LowCodeRenderer',
customCreateElement: (Comp: any, props: any, children: any) => {
const componentMeta = host.currentDocument?.getComponentMeta(Comp.displayName);
if (componentMeta?.isModal) {

View File

@ -176,6 +176,7 @@ class Renderer extends Component<{
suspended={renderer.suspended}
self={renderer.scope}
getNode={(id: string) => documentInstance.getNode(id) as Node}
rendererName="PageRenderer"
customCreateElement={(Component: any, props: any, children: any) => {
const { __id, ...viewProps } = props;
viewProps.componentId = __id;

View File

@ -453,6 +453,7 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
designMode: renderer.designMode,
device: renderer.device,
appHelper: renderer.context,
rendererName: 'LowCodeRenderer',
customCreateElement: (Comp: any, props: any, children: any) => {
const componentMeta = host.currentDocument?.getComponentMeta(Comp.displayName);
if (componentMeta?.isModal) {

View File

@ -17,6 +17,7 @@ export interface IProps {
onCompGetRef?: (schema: ISchema, ref: any) => void;
onCompGetCtx?: (schema: ISchema, ref: any) => void;
customCreateElement?: (...args: any) => any;
rendererName: string;
notFoundComponent?: any;
faultComponent?: any;
}