Skip to content

Popconfirm 气泡确认框

点击元素弹出气泡确认框,常用于一些需要二次确认的危险操作。

基础用法

在需要二次确认的元素外包一层 ZcPopconfirm 即可。

危险操作

使用 danger 属性将确认按钮标红,强调操作的危险性。

自定义内容

使用插槽自定义气泡内容,通过 v-model:visible 控制显隐。

Popconfirm API

Props

参数说明类型默认值
title确认框标题string'Are you sure?'
description确认框描述string''
confirmButtonText确认按钮文字string'Confirm'
cancelButtonText取消按钮文字string'Cancel'
confirmButtonType确认按钮类型string'primary'
cancelButtonType取消按钮类型string'default'
danger是否为危险操作booleanfalse
hideCancelButton是否隐藏取消按钮booleanfalse
hideConfirmButton是否隐藏确认按钮booleanfalse
disabled是否禁用booleanfalse
placement弹出位置'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end''top'
trigger触发方式'hover' | 'click''click'
visible是否显示 (v-model:visible)booleanfalse
showArrow是否显示箭头booleantrue
width弹出框宽度number220
icon自定义图标类名string''

Events

事件名说明回调参数
confirm点击确认按钮时触发
cancel点击取消按钮时触发

Slots

插槽名说明
default触发元素

基于 MIT 许可发布