Skip to content

Commit e1dd8e0

Browse files
liujupingJackLian
authored andcommitted
docs: add config options doc
1 parent 3b36926 commit e1dd8e0

2 files changed

Lines changed: 286 additions & 110 deletions

File tree

docs/docs/api/configOptions.md

Lines changed: 285 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,285 @@
1+
---
2+
title: config options - 配置列表
3+
sidebar_position: 13
4+
---
5+
6+
> **@types** [IPublicTypeEngineOptions](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/type/engine-options.ts)<br/>
7+
8+
## 配置方式
9+
10+
#### init API
11+
12+
```javascript
13+
import { init } from '@alilc/lowcode-engine';
14+
15+
init(document.getElementById('engine'), {
16+
enableCondition: false,
17+
});
18+
```
19+
20+
[**init api**](./init)
21+
22+
#### config API
23+
24+
```javascript
25+
import { config } from '@alilc/lowcode-engine';
26+
27+
config.set('enableCondition', false)
28+
```
29+
30+
[**config api**](./config)
31+
32+
## 配置详情
33+
34+
> 源码详见 [IPublicTypeEngineOptions](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/type/engine-options.ts)
35+
36+
37+
### 画布
38+
39+
#### locale - 语言
40+
41+
`@type {string}``@default {zh-CN}`
42+
43+
语言
44+
45+
#### device - 设备类型
46+
47+
`@type {string}`
48+
49+
引擎默认支持的 device 类型有 `default``mobile``iphonex``iphone6`
50+
51+
插件 `@alilc/lowcode-plugin-simulator-select` 支持的 device 类型有 `default``phone``tablet``desktop`
52+
53+
如果需要自定义的 device 类型,需要补充 device 类型对应的样式,例如 device 为 phone 时,需要补充样式如下:
54+
55+
```css
56+
.lc-simulator-device-phone {
57+
top: 16px;
58+
bottom: 16px;
59+
left: 50%;
60+
width: 375px;
61+
transform: translateX(-50%);
62+
margin: auto;
63+
}
64+
```
65+
66+
#### deviceClassName
67+
68+
`@type {string}`
69+
70+
指定初始化的 deviceClassName,挂载到画布的顶层节点上
71+
72+
#### appHelper
73+
74+
与 react-renderer 的 appHelper 一致,https://lowcode-engine.cn/site/docs/guide/expand/runtime/renderer#apphelper
75+
76+
77+
#### enableCondition
78+
79+
`@type {boolean}`
80+
81+
是否开启 condition 的能力,默认在设计器中不管 condition 是啥都正常展示
82+
83+
#### disableAutoRender
84+
85+
`@type {boolean}` `@default {false}`
86+
87+
关闭画布自动渲染,在资产包多重异步加载的场景有效
88+
89+
#### renderEnv - 渲染器类型
90+
91+
渲染器类型
92+
93+
`@type {string}``@default {react}`
94+
95+
#### simulatorUrl
96+
97+
`@type {string[]}`
98+
99+
设置 simulator 相关的 url
100+
101+
#### enableStrictNotFoundMode
102+
103+
`@type {boolean}` `@default {false}`
104+
105+
当开启组件未找到严格模式时,渲染模块不会默认给一个容器组件
106+
107+
### 编排
108+
109+
#### focusNodeSelector - 指定根组件
110+
111+
配置指定节点为根组件
112+
113+
类型定义
114+
115+
```typescript
116+
focusNodeSelector?: (rootNode: Node) => Node;
117+
```
118+
119+
#### supportVariableGlobally - 全局变量配置
120+
121+
`@type {boolean}` `@default {false}`
122+
123+
设置所有属性支持变量配置
124+
125+
开启拖拽组件时,即将被放入的容器是否有视觉反馈
126+
127+
#### customizeIgnoreSelectors - 点击忽略
128+
129+
定制画布中点击被忽略的 selectors
130+
131+
类型定义:
132+
133+
```typescript
134+
customizeIgnoreSelectors?: (defaultIgnoreSelectors: string[], e: MouseEvent) => string[];
135+
```
136+
137+
默认值:
138+
139+
```javascript
140+
() => {
141+
return [
142+
'.next-input-group',
143+
'.next-checkbox-group',
144+
'.next-checkbox-wrapper',
145+
'.next-date-picker',
146+
'.next-input',
147+
'.next-month-picker',
148+
'.next-number-picker',
149+
'.next-radio-group',
150+
'.next-range',
151+
'.next-range-picker',
152+
'.next-rating',
153+
'.next-select',
154+
'.next-switch',
155+
'.next-time-picker',
156+
'.next-upload',
157+
'.next-year-picker',
158+
'.next-breadcrumb-item',
159+
'.next-calendar-header',
160+
'.next-calendar-table',
161+
'.editor-container', // 富文本组件
162+
]
163+
}
164+
```
165+
166+
#### enableCanvasLock
167+
168+
`@type {boolean}` `@default {false}`
169+
170+
打开画布的锁定操作
171+
172+
#### enableLockedNodeSetting
173+
174+
`@type {boolean}` `@default {false}`
175+
176+
容器锁定后,容器本身是否可以设置属性,仅当画布锁定特性开启时生效
177+
178+
#### enableMouseEventPropagationInCanvas
179+
180+
`@type {boolean}` `@default {false}`
181+
182+
鼠标事件在画布中是否允许冒泡
183+
184+
#### enableReactiveContainer
185+
186+
`@type {boolean}` `@default {false}`
187+
188+
#### disableDetecting
189+
190+
`@type {boolean}` `@default {false}`
191+
192+
关闭拖拽组件时的虚线响应,性能考虑
193+
194+
195+
#### disableDefaultSettingPanel
196+
197+
`@type {boolean}` `@default {false}`
198+
199+
禁止默认的设置面板
200+
201+
#### disableDefaultSetters
202+
203+
`@type {boolean}` `@default {false}`
204+
205+
禁止默认的设置器
206+
207+
#### stayOnTheSameSettingTab
208+
209+
`@type {boolean}` `@default {false}`
210+
211+
当选中节点切换时,是否停留在相同的设置 tab 上
212+
213+
#### hideSettingsTabsWhenOnlyOneItem
214+
215+
`@type {boolean}` `@default {false}`
216+
217+
是否在只有一个 item 的时候隐藏设置 tabs
218+
219+
#### thisRequiredInJSE
220+
221+
`@type {boolean}` `@default {true}`
222+
223+
JSExpression 是否只支持使用 this 来访问上下文变量,假如需要兼容原来的 'state.xxx',则设置为 false
224+
225+
### 应用级设计器
226+
227+
#### enableWorkspaceMode - 应用级设计模式
228+
229+
`@type {boolean}` `@default {false}`
230+
231+
开启应用级设计模式
232+
233+
#### enableAutoOpenFirstWindow
234+
235+
`@type {boolean}` `@default {true}`
236+
237+
应用级设计模式下,自动打开第一个窗口
238+
239+
#### workspaceEmptyComponent
240+
241+
应用级设计模式下,当窗口为空时,展示的占位组件
242+
243+
### 定制组件
244+
245+
#### faultComponent
246+
247+
组件渲染错误时的占位组件
248+
249+
#### notFoundComponent
250+
251+
组件不存在时的占位组件
252+
253+
#### loadingComponent - loading 组件
254+
255+
自定义 loading 组件
256+
257+
### 其他
258+
259+
#### enableStrictPluginMode
260+
261+
`@type {boolean}`
262+
263+
开启严格插件模式,默认值:STRICT_PLUGIN_MODE_DEFAULT , 严格模式下,插件将无法通过 engineOptions 传递自定义配置项
264+
265+
#### requestHandlersMap
266+
267+
数据源引擎的请求处理器映射
268+
269+
#### customPluginTransducer
270+
271+
插件处理中间件,方便提供插件调试能力
272+
273+
类型定义
274+
275+
```typescript
276+
customPluginTransducer: async (originPlugin: IPublicTypePlugin, ctx: IPublicModelPluginContext, options): IPublicTypePlugin;
277+
```
278+
279+
#### defaultOutlinePaneProps
280+
281+
`@type {object}`
282+
283+
大纲树插件面板默认 props
284+
285+

0 commit comments

Comments
 (0)