Popconfirm 气泡确认框
在元素点击操作外提供轻量二次确认。
位置
气泡确认框共 9 种方位。
title 设置点击参考元素时展示的内容;placement 为 [方向]-[对齐]:方向含 top、left、right、bottom,对齐含 start、end、空(默认居中)。例如 placement="left-end" 表示在左侧展示,且底部与参考元素底部对齐。
基础用法
与气泡卡片类似,重复属性参见气泡卡片文档。
气泡确认框仅 title 生效,content 会被忽略。
自定义
可按需定制气泡确认框。
头部图标
使用 header-title、header-icon 和 header-icon-color 在顶部显示带图标的标题区域。
通过设置 header-title、header-icon 和 header-icon-color 可以在气泡确认框顶部显示一个醒目的标题区域,用于强调操作类型或重要信息。header-icon 与 icon 的区别在于:header-icon 显示在顶部标题区域,而 icon 显示在主内容区域(title 旁边)。
触发事件
点击按钮触发。
气泡确认框 API
气泡确认框 属性
| 名称 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| title | 标题 | string | — |
| headerTitle | 头部标题文本 | string | — |
| headerIcon | 头部图标组件 | string / Component | — |
| headerIconColor | 头部图标颜色 | string | — |
| effect | 文字提示主题,内置 dark / light | enum / string | light |
| confirm-button-text | 确定按钮文案 | string | — |
| cancel-button-text | 取消按钮文案 | string | — |
| confirm-button-type | 确定按钮类型 | enum | primary |
| cancel-button-type | 取消按钮类型 | enum | text |
| icon | 图标组件 | string / Component | QuestionFilled |
| icon-color | 图标颜色 | string | #f90 |
| hide-icon | 是否隐藏图标 | boolean | false |
| hide-after | 延迟关闭(毫秒) | number | 200 |
| teleported | 是否将内容传送到 body | boolean | true |
| persistent | 失活且为 false 时销毁 | boolean | false |
| width | 宽度,最小 150px | string / number | 150 |
| 文字提示 | 继承 Tooltip 全部属性,除:popper-class、popper-style、fallback-placements | — | — |
气泡确认框 事件
| 名称 | 说明 | 类型 |
|---|---|---|
| confirm | 点击确定按钮时 | Function |
| cancel | 点击取消按钮时 | Function |
气泡确认框 插槽
| 名称 | 说明 | 类型 |
|---|---|---|
| reference | 触发气泡确认框的元素 | — |
| actions | 底部操作区内容 | object |
气泡确认框 暴露
| 名称 | 说明 | 类型 |
|---|---|---|
| popperRef | Popper 组件实例引用 | object |
| hide | 隐藏气泡确认框 | Function |