zan-layer 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -0
- package/lib/zan-layer.js +626 -514
- package/lib/zan-layer.umd.js +1 -1
- package/package.json +8 -8
- package/types/component/ZanLayer.vue.d.ts +3 -2
- package/types/composable/useDragable.d.ts +11 -1
- package/types/index.d.ts +2 -1
- package/types/types/index.d.ts +13 -1
- package/types/utils/index.d.ts +3 -0
package/README.md
CHANGED
|
@@ -178,6 +178,12 @@ layer.prompt({
|
|
|
178
178
|
| `footer` | 底部区域内容 |
|
|
179
179
|
| `content` | 主体内容,支持字符串、VNode、函数 |
|
|
180
180
|
| `area` | 宽高,如 `'560px'` 或 `['720px', '560px']` |
|
|
181
|
+
| `width` | 单独指定宽度,会覆盖 `area[0]` |
|
|
182
|
+
| `height` | 单独指定高度,会覆盖 `area[1]` |
|
|
183
|
+
| `minWidth` | 最小宽度,支持数字或 CSS 尺寸字符串 |
|
|
184
|
+
| `maxWidth` | 最大宽度,支持数字或 CSS 尺寸字符串 |
|
|
185
|
+
| `minHeight` | 最小高度,支持数字或 CSS 尺寸字符串 |
|
|
186
|
+
| `maxHeight` | 最大高度,支持数字或 CSS 尺寸字符串 |
|
|
181
187
|
| `offset` | 位置,如 `'r'`、`'rt'`、`'auto'` 或坐标数组 |
|
|
182
188
|
| `shade` | 是否显示遮罩 |
|
|
183
189
|
| `shadeClose` | 点击遮罩是否关闭 |
|
|
@@ -302,6 +308,12 @@ layer.open({
|
|
|
302
308
|
layer.open({
|
|
303
309
|
title: '可拖拽窗口',
|
|
304
310
|
content: '拖动后记录位置',
|
|
311
|
+
width: 720,
|
|
312
|
+
height: 520,
|
|
313
|
+
minWidth: 480,
|
|
314
|
+
minHeight: 320,
|
|
315
|
+
maxWidth: '90vw',
|
|
316
|
+
maxHeight: '90vh',
|
|
305
317
|
move: true,
|
|
306
318
|
resize: true,
|
|
307
319
|
moveEnd: (id, options) => {
|
|
@@ -323,6 +335,26 @@ layer.open({
|
|
|
323
335
|
- `layer.min(id)`
|
|
324
336
|
- `layer.full(id)`
|
|
325
337
|
- `layer.revert(id)`
|
|
338
|
+
- `layer.resize(id, { width, height })`
|
|
339
|
+
|
|
340
|
+
示例:
|
|
341
|
+
|
|
342
|
+
```ts
|
|
343
|
+
const layerId = layer.open({
|
|
344
|
+
title: '尺寸可控窗口',
|
|
345
|
+
content: '支持程序化改大小',
|
|
346
|
+
width: 640,
|
|
347
|
+
height: 420,
|
|
348
|
+
minWidth: 420,
|
|
349
|
+
minHeight: 260,
|
|
350
|
+
resize: true
|
|
351
|
+
})
|
|
352
|
+
|
|
353
|
+
layer.resize(layerId, {
|
|
354
|
+
width: '80vw',
|
|
355
|
+
height: '70vh'
|
|
356
|
+
})
|
|
357
|
+
```
|
|
326
358
|
|
|
327
359
|
## 安装选项
|
|
328
360
|
|