forked from alibaba/lowcode-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpage.tsx
More file actions
36 lines (32 loc) · 1.09 KB
/
page.tsx
File metadata and controls
36 lines (32 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { pageRendererFactory, types } from '@alilc/lowcode-renderer-core';
export default function raxPageRendererFactory() {
const OriginPage = pageRendererFactory();
return class PageRenderer extends OriginPage {
async componentDidUpdate() {
// @ts-ignore
super.componentDidUpdate(...arguments);
}
render() {
// @ts-ignore
const that: types.IRenderer = this;
const { __schema, __components } = that.props;
if (that.__checkSchema(__schema)) {
return '页面 schema 结构异常!';
}
that.__debug(`render - ${__schema?.fileName}`);
const { Page } = __components as any;
if (Page) {
const children = ((context) => {
that.context = context;
that.__render();
return that.__renderComp(Page, { pageContext: that });
});
return that.__renderContextConsumer(children);
}
return that.__renderContent(that.__renderContextConsumer((context) => {
that.context = context;
return that.__renderContextProvider({ pageContext: that });
}));
}
};
}