diff --git a/packages/runtime/src/boot.ts b/packages/runtime/src/boot.ts index 2598b18fe..6b99987e1 100644 --- a/packages/runtime/src/boot.ts +++ b/packages/runtime/src/boot.ts @@ -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; } } diff --git a/packages/runtime/src/lazyComponent.tsx b/packages/runtime/src/lazyComponent.tsx index 9acd799ce..b75bf8162 100644 --- a/packages/runtime/src/lazyComponent.tsx +++ b/packages/runtime/src/lazyComponent.tsx @@ -18,7 +18,7 @@ export default class LazyComponent extends Component { }; } - 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 { } } - public render() { + render() { const { getPageData, ...restProps } = this.props; const { schema } = this.state; const Renderer = Boot.getRenderer(); diff --git a/packages/runtime/src/provider.ts b/packages/runtime/src/provider.ts index b0535d89d..1af619faf 100644 --- a/packages/runtime/src/provider.ts +++ b/packages/runtime/src/provider.ts @@ -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 { + create(appkey: string): Promise { 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 { + async getAppData(appkey: string, restOptions?: any): Promise { console.log('getAppData'); return {}; } - public async getPageData(pageId: string, restOptions?: any): Promise { + async getPageData(pageId: string, restOptions?: any): Promise { 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; }