Skip to content

Commit abd9ed3

Browse files
liujupingJackLian
authored andcommitted
docs: update init.md, add device 参数详细说明
1 parent c458b1b commit abd9ed3

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

docs/docs/api/init.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,33 @@ init(document.getElementById('engine'), {
118118
enableCondition: false,
119119
});
120120
```
121-
###
121+
122122
### 默认打开移动端画布
123123
```typescript
124124
import { init } from '@alilc/lowcode-engine';
125125
126126
init({
127127
device: 'mobile',
128128
});
129+
```
130+
### device 参数详细说明
131+
132+
引擎默认支持的 device 类型有 `default``mobile``iphonex``iphone6`
133+
134+
插件 `@alilc/lowcode-plugin-simulator-select` 支持的 device 类型有 `default``phone``tablet``desktop`
135+
136+
如果需要自定义的 device 类型,需要补充 device 类型对应的样式,例如 devicephone 时,需要补充样式如下:
137+
138+
```css
139+
.lc-simulator-device-phone {
140+
top: 16px;
141+
bottom: 16px;
142+
left: 50%;
143+
width: 375px;
144+
transform: translateX(-50%);
145+
margin: auto;
146+
}
147+
129148
```
130149

131150
### 使用 utils 第三方工具扩展

0 commit comments

Comments
 (0)