气泡确认框
点击元素,弹出气泡确认框。
位置
Popconfirm 气泡确认框有 9 个不同的方位。
基础用法
Popconfirm 的属性与 Popover 很类似,因此对于重复的属性,请参考 Popover 的文档。
自定义
你可以像这样自定义 Popconfirm 气泡确认框
触发事件
点击按钮触发事件
API
属性
| 名称 | 描述 | 类型 | 默认值 |
|---|---|---|---|
| title | 标题 | string | — |
| effect 2.11.2 | Tooltip 的主题,内置主题:`dark` / `light` | enum / string | light |
| 确认按钮文字 | 确认按钮文字 | string | — |
| 取消按钮文字 | 取消按钮文字 | string | — |
| 确认按钮类型 | 确认按钮类型 | 枚举 | 主要 |
| 取消按钮类型 | 取消按钮类型 | 枚举 | 文本 |
| icon | Icon 组件 | string / Component | QuestionFilled |
| 图标颜色 | Icon 颜色 | string | #f90 |
| 隐藏图标 | 是否隐藏 Icon | boolean | false |
| hide-after | 延迟消失,单位毫秒 | number | 200 |
| teleported | popconfirm 的内容是否被插入到 body 元素上 | boolean | true |
| persistent | 当 popconfirm 不再触发且 persistent 为 false 时,popconfirm 将会被销毁 | boolean | false |
| width | popconfirm 宽度,最小宽度 150px | string / number | 150 |
| tooltip | 继承 Tooltip 的所有属性,除了:popper-class、popper-style、fallback-placements | — | — |
事件
| 名称 | 描述 | 类型 |
|---|---|---|
| 确定 | 当点击确认按钮时触发 | Function |
| 取消 | 当点击取消按钮时触发 | Function |
插槽
| 名称 | 描述 | 类型 |
|---|---|---|
| 触发 Popconfirm 的 HTML 元素 | 触发 Popconfirm 的 HTML 元素 | — |
| actions 2.8.1 | Popconfirm 气泡确认框的页脚内容 | object |
暴露
| 名称 | 描述 | 类型 |
|---|---|---|
| popperRef 2.10.7 | el-popper 组件实例 | object |
| 隐藏 2.10.7 | 隐藏 popconfirm | Function |