增加测量窗口
This commit is contained in:
@@ -105,6 +105,20 @@ constructor(options: DialogOptions)
|
||||
- 清空当前内容
|
||||
- 设置新内容(支持 HTML 字符串或 DOM 元素)
|
||||
|
||||
#### `fitHeight(recenter: boolean = false): void`
|
||||
根据内容自动调整弹窗高度
|
||||
|
||||
**使用场景**:
|
||||
- 弹窗内容存在“展开/收起”等高度变化的交互(例如测量面板展开后需要增高弹窗,避免遮挡底部操作按钮)
|
||||
|
||||
**参数**:
|
||||
- `recenter`: 是否根据 `options.position` 重新计算定位(默认 `false`)
|
||||
|
||||
**行为**:
|
||||
- 先将高度设置为 `auto`,获取自然高度
|
||||
- 再将高度夹紧到 `[minHeight, containerHeight]` 范围内
|
||||
- 默认不重置用户拖拽后的 `left/top`,仅做边界夹紧;若 `recenter=true` 则按 `position` 重新定位
|
||||
|
||||
#### `close(): void`
|
||||
关闭弹窗并销毁
|
||||
|
||||
@@ -890,3 +904,4 @@ interface DialogColors {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user