Popconfirm

点击元素,弹出气泡式的确认框。

何时使用

目标元素的操作需要用户进一步的确认时,在目标元素附近弹出浮层提示,询问用户。

和 ‘confirm’ 弹出的全屏居中模态对话框相比,交互形式更轻量。

代码演示

Delete

基本

最简单的用法。

expand code expand code
Delete

国际化

使用 okTextcancelText 自定义按钮文字。

expand code expand code

位置

位置有十二个方向。如需箭头指向目标元素中心,可以设置 arrowPointAtCenter

expand code expand code
Delete a task

Whether directly execute:

条件触发

可以判断是否需要弹出。

expand code expand code
Delete

自定义 Icon 图标

使用 icon 自定义提示 icon

expand code expand code

API

参数 说明 类型 默认值
cancelText 取消按钮文字 string|slot 取消
okText 确认按钮文字 string|slot 确定
okType 确认按钮类型 string primary
title 确认框的描述 string|slot
icon 自定义弹出气泡 Icon 图标 ReactNode <Icon type="exclamation-circle" />

事件

事件名称 说明 回调参数
cancel 点击取消的回调 function(e)
confirm 点击确认的回调 function(e)
visibleChange 显示隐藏的回调 function(visible)

更多属性请参考 Tooltip

注意

请确保 Popconfirm 的子元素能接受 mouseentermouseleavefocusclick 事件。

  Notification 通知提醒框Progress 进度条