模态框 Modal
模态框用于展示重要内容或需要用户确认的操作。
基础模态框
UI.modal.open({
title: '提示',
content: '这是一个基础模态框'
})
确认对话框
const result = await UI.modal.confirm({
title: '确认操作',
content: '确定要执行此操作吗?'
})
// 危险操作
await UI.modal.confirm({
title: '删除确认',
content: '此操作不可恢复',
danger: true
})
API
| 方法 | 说明 |
|---|---|
UI.modal.open(options) | 打开模态框 |
UI.modal.close() | 关闭模态框 |
UI.modal.confirm(options) | 确认对话框 |