mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-12 17:08:14 +00:00
feat:支持appHelper
This commit is contained in:
parent
f224abffff
commit
9ffbdc2d1c
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ali/lowcode-react-provider",
|
||||
"version": "1.0.6-1",
|
||||
"version": "1.0.6",
|
||||
"description": "React Provider for Runtime",
|
||||
"files": [
|
||||
"es",
|
||||
@ -26,6 +26,7 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@ali/lowcode-runtime": "^1.0.6-0",
|
||||
"@ali/lowcode-utils": "^0.8.22",
|
||||
"@recore/router": "^1.0.11",
|
||||
"react": "^16",
|
||||
"react-dom": "^16"
|
||||
|
||||
@ -2,6 +2,7 @@ import { createElement, ReactType, ReactElement } from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { Router } from '@recore/router';
|
||||
import { app, Provider } from '@ali/lowcode-runtime';
|
||||
import { AppHelper } from '@ali/lowcode-utils';
|
||||
import LazyComponent from './components/LazyComponent';
|
||||
|
||||
export default class ReactProvider extends Provider {
|
||||
@ -80,11 +81,15 @@ export default class ReactProvider extends Provider {
|
||||
defined: { keepAlive: true },
|
||||
});
|
||||
}
|
||||
const appHelper = new AppHelper();
|
||||
appHelper.set('utils', this.getUtils());
|
||||
appHelper.set('constants', this.getConstants());
|
||||
const RouterView = (props: any) => {
|
||||
return createElement(Router as any, {
|
||||
routes,
|
||||
components: this.getComponents(),
|
||||
utils: this.getUtils(),
|
||||
appHelper,
|
||||
componentsMap: this.getComponentsMapObj(),
|
||||
...props,
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user