mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 11:20:11 +00:00
chore: remove public identider
This commit is contained in:
parent
8174b42fa3
commit
904bd3d4a2
@ -7,36 +7,36 @@ class Trunk {
|
||||
private layouts: { [key: string]: TComponent } = {};
|
||||
private loading: TComponent | null = null;
|
||||
|
||||
public registerRenderer(renderer: TComponent): any {
|
||||
registerRenderer(renderer: TComponent): any {
|
||||
this.renderer = renderer;
|
||||
}
|
||||
|
||||
public registerLayout(componentName: string, Layout: TComponent): any {
|
||||
registerLayout(componentName: string, Layout: TComponent): any {
|
||||
if (!componentName || !Layout) {
|
||||
return;
|
||||
}
|
||||
this.layouts[componentName] = Layout;
|
||||
}
|
||||
|
||||
public registerLoading(component: TComponent) {
|
||||
registerLoading(component: TComponent) {
|
||||
if (!component) {
|
||||
return;
|
||||
}
|
||||
this.loading = component;
|
||||
}
|
||||
|
||||
public getLayout(componentName: string) {
|
||||
getLayout(componentName: string) {
|
||||
if (!componentName) {
|
||||
return;
|
||||
}
|
||||
return this.layouts[componentName];
|
||||
}
|
||||
|
||||
public getRenderer(): TComponent | null {
|
||||
getRenderer(): TComponent | null {
|
||||
return this.renderer;
|
||||
}
|
||||
|
||||
public getLoading(): TComponent | null {
|
||||
getLoading(): TComponent | null {
|
||||
return this.loading;
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ export default class LazyComponent extends Component<IProps, IState> {
|
||||
};
|
||||
}
|
||||
|
||||
public async componentDidMount() {
|
||||
async componentDidMount() {
|
||||
const { getPageData } = this.props;
|
||||
if (getPageData && !this.state.schema) {
|
||||
const schema = await getPageData();
|
||||
@ -26,7 +26,7 @@ export default class LazyComponent extends Component<IProps, IState> {
|
||||
}
|
||||
}
|
||||
|
||||
public render() {
|
||||
render() {
|
||||
const { getPageData, ...restProps } = this.props;
|
||||
const { schema } = this.state;
|
||||
const Renderer = Boot.getRenderer();
|
||||
|
||||
@ -24,17 +24,18 @@ export interface IAppConfig {
|
||||
}
|
||||
|
||||
export default abstract class Provider {
|
||||
public globalComponents: any = {};
|
||||
public globalUtils: any = {};
|
||||
public routerConfig: { [key: string]: string } = {};
|
||||
public layout: { componentName: string; props: any } | null = null;
|
||||
globalComponents: any = {};
|
||||
globalUtils: any = {};
|
||||
routerConfig: { [key: string]: string } = {};
|
||||
layout: { componentName: string; props: any } | null = null;
|
||||
componentsMap: any = null;
|
||||
private lazyElementsMap: { [key: string]: any } = {};
|
||||
|
||||
constructor() {
|
||||
this.init();
|
||||
}
|
||||
|
||||
public create(appkey: string): Promise<IAppData> {
|
||||
create(appkey: string): Promise<IAppData> {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
try {
|
||||
const config = await this.getAppData(appkey);
|
||||
@ -49,21 +50,21 @@ export default abstract class Provider {
|
||||
});
|
||||
}
|
||||
|
||||
public async init() {
|
||||
async init() {
|
||||
console.log('init');
|
||||
}
|
||||
|
||||
public async getAppData(appkey: string, restOptions?: any): Promise<object> {
|
||||
async getAppData(appkey: string, restOptions?: any): Promise<object> {
|
||||
console.log('getAppData');
|
||||
return {};
|
||||
}
|
||||
|
||||
public async getPageData(pageId: string, restOptions?: any): Promise<any> {
|
||||
async getPageData(pageId: string, restOptions?: any): Promise<any> {
|
||||
console.log('getPageData');
|
||||
return;
|
||||
}
|
||||
|
||||
public getLazyComponent(pageId: string, props: any): ReactElement | null {
|
||||
getLazyComponent(pageId: string, props: any): ReactElement | null {
|
||||
if (!pageId) {
|
||||
return null;
|
||||
}
|
||||
@ -82,7 +83,7 @@ export default abstract class Provider {
|
||||
}
|
||||
}
|
||||
|
||||
public createApp() {
|
||||
createApp() {
|
||||
console.log('createApp');
|
||||
return;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user