AlertDialog 警告对话框
强制用户确认的模态对话框
何时使用
- 需要用户强制确认的警告对话框时。
- 操作具有破坏性、需要二次确认时。
导入
基础用法
警告对话框用于强制用户在继续操作前进行确认。与普通 Dialog 不同,AlertDialog 不会响应 ESC 键和遮罩点击关闭,用户必须明确点击「确认」或「取消」。
受控用法
通过 v-model:open 在外部控制打开状态。
API
AlertDialog Props
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| open (v-model) | 是否打开 | boolean | - |
AlertDialogContent Props
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| class | 附加类名 | string | - |
导出组件
| 组件 | 说明 |
|---|---|
| AlertDialog | 根组件 |
| AlertDialogContent | 内容容器 |
| AlertDialogHeader | 头部 |
| AlertDialogFooter | 底部 |
| AlertDialogTitle | 标题 |
| AlertDialogDescription | 描述 |
| AlertDialogAction | 确认按钮(需手动 @click="open = false" 关闭) |
| AlertDialogCancel | 取消按钮(需手动 @click="open = false" 关闭) |
