forked from alibaba/lowcode-engine
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.ts
More file actions
39 lines (36 loc) · 1.25 KB
/
index.ts
File metadata and controls
39 lines (36 loc) · 1.25 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
37
38
39
import { init, plugins } from '@felce/lowcode-engine';
import { createFetchHandler } from '@alilc/lowcode-datasource-fetch-handler';
import EditorInitPlugin from './plugins/plugin-editor-init';
import DefaultSettersRegistryPlugin from './plugins/plugin-default-setters-registry';
import appHelper from './helper';
import './index.scss';
await plugins.register(EditorInitPlugin, {
scenarioName: 'general',
displayName: '综合场景',
info: {
urls: [
{
key: '设计器',
value: 'https://github.com/alibaba/lowcode-demo/tree/main/demo-general',
},
],
},
});
// 设置内置 setter 和事件绑定、插件绑定面板
await plugins.register(DefaultSettersRegistryPlugin);
init(document.getElementById('lce-container')!, {
locale: 'zh-CN',
enableCondition: true,
enableCanvasLock: true,
// 默认绑定变量
supportVariableGlobally: true,
requestHandlersMap: {
fetch: createFetchHandler(),
},
simulatorUrl: [
'https://registry.npmmirror.com/@felce/lowcode-react-simulator-renderer/latest/files/dist/react-simulator-renderer.css',
'https://registry.npmmirror.com/@felce/lowcode-react-simulator-renderer/latest/files/dist/react-simulator-renderer.umd.js',
],
appHelper,
enableContextMenu: true,
});