Popconfirm 气泡确认框

在元素点击操作外提供轻量二次确认。

位置

气泡确认框共 9 种方位。

title 设置点击参考元素时展示的内容;placement[方向]-[对齐]:方向含 topleftrightbottom,对齐含 startend、空(默认居中)。例如 placement="left-end" 表示在左侧展示,且底部与参考元素底部对齐。

基础用法

与气泡卡片类似,重复属性参见气泡卡片文档。

气泡确认框仅 title 生效,content 会被忽略。

自定义

可按需定制气泡确认框。

头部图标

使用 header-titleheader-iconheader-icon-color 在顶部显示带图标的标题区域。

通过设置 header-titleheader-iconheader-icon-color 可以在气泡确认框顶部显示一个醒目的标题区域,用于强调操作类型或重要信息。header-iconicon 的区别在于:header-icon 显示在顶部标题区域,而 icon 显示在主内容区域(title 旁边)。

触发事件

点击按钮触发。

气泡确认框 API

气泡确认框 属性

名称说明类型默认值
title标题string
headerTitle头部标题文本string
headerIcon头部图标组件string / Component
headerIconColor头部图标颜色string
effect文字提示主题,内置 dark / lightenum / stringlight
confirm-button-text确定按钮文案string
cancel-button-text取消按钮文案string
confirm-button-type确定按钮类型enumprimary
cancel-button-type取消按钮类型enumtext
icon图标组件string / ComponentQuestionFilled
icon-color图标颜色string#f90
hide-icon是否隐藏图标booleanfalse
hide-after延迟关闭(毫秒)number200
teleported是否将内容传送到 bodybooleantrue
persistent失活且为 false 时销毁booleanfalse
width宽度,最小 150pxstring / number150
文字提示继承 Tooltip 全部属性,除:popper-classpopper-stylefallback-placements

气泡确认框 事件

名称说明类型
confirm点击确定按钮时Function
cancel点击取消按钮时Function

气泡确认框 插槽

名称说明类型
reference触发气泡确认框的元素
actions底部操作区内容object

气泡确认框 暴露

名称说明类型
popperRefPopper 组件实例引用object
hide隐藏气泡确认框Function