mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 03:01:16 +00:00
feat: sync utils/constants (#506)
This commit is contained in:
parent
8255b79458
commit
2871b5ba4c
@ -190,6 +190,7 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
|
|||||||
this.componentsConsumer = new ResourceConsumer<Asset | undefined>(() => this.componentsAsset);
|
this.componentsConsumer = new ResourceConsumer<Asset | undefined>(() => this.componentsAsset);
|
||||||
this.injectionConsumer = new ResourceConsumer(() => {
|
this.injectionConsumer = new ResourceConsumer(() => {
|
||||||
return {
|
return {
|
||||||
|
appHelper: engineConfig.get('appHelper'),
|
||||||
i18n: this.project.i18n,
|
i18n: this.project.i18n,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@ -208,6 +208,15 @@ export interface EngineOptions {
|
|||||||
// 是否开启在 render 阶段开启 filter reducer,默认值:false
|
// 是否开启在 render 阶段开启 filter reducer,默认值:false
|
||||||
enableFilterReducerInRenderStage?: boolean;
|
enableFilterReducerInRenderStage?: boolean;
|
||||||
};
|
};
|
||||||
|
/**
|
||||||
|
* 与 react-renderer 的 appHelper 一致, https://lowcode-engine.cn/docV2/nhilce#appHelper
|
||||||
|
*/
|
||||||
|
appHelper?: {
|
||||||
|
/** 全局公共函数 */
|
||||||
|
utils?: Record<string, any>;
|
||||||
|
/** 全局常量 */
|
||||||
|
constants?: Record<string, any>;
|
||||||
|
};
|
||||||
|
|
||||||
requestHandlersMap: RequestHandlersMap;
|
requestHandlersMap: RequestHandlersMap;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,6 +25,7 @@ import { createMemoryHistory, MemoryHistory } from 'history';
|
|||||||
import Slot from './builtin-components/slot';
|
import Slot from './builtin-components/slot';
|
||||||
import Leaf from './builtin-components/leaf';
|
import Leaf from './builtin-components/leaf';
|
||||||
import { withQueryParams, parseQuery } from './utils/url';
|
import { withQueryParams, parseQuery } from './utils/url';
|
||||||
|
import { merge } from 'lodash';
|
||||||
|
|
||||||
const loader = new AssetLoader();
|
const loader = new AssetLoader();
|
||||||
configure({ enforceActions: 'never' });
|
configure({ enforceActions: 'never' });
|
||||||
@ -308,6 +309,7 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
|
|||||||
...this._appContext,
|
...this._appContext,
|
||||||
};
|
};
|
||||||
newCtx.utils.i18n.messages = data.i18n || {};
|
newCtx.utils.i18n.messages = data.i18n || {};
|
||||||
|
merge(newCtx, data.appHelper || {});
|
||||||
this._appContext = newCtx;
|
this._appContext = newCtx;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user