Skip to content

FxPopconfirm 气泡确认框

点击触发元素弹出确认气泡,含确认 / 取消按钮。基于 FxPopover。

基础用法

title 设置提示内容,@confirm / @cancel 监听确认 / 取消。

出现位置

placement 控制弹出方向。

自定义按钮

confirm-button-text / cancel-button-text 自定义按钮文字,confirm-button-type / cancel-button-type 自定义类型。

自定义按钮区

actions 插槽可完全替换底部按钮区,作用域提供 { confirm, cancel },调用即触发对应事件并关闭。

局部引入

ts
import { FxPopconfirm } from "@fx/components"

API

Attributes

名称说明类型默认值
title标题(提示内容)string
confirm-button-text确认按钮文字string确定
cancel-button-text取消按钮文字string取消
confirm-button-type确认按钮类型ButtonTypeprimary
cancel-button-type取消按钮类型ButtonType
icon自定义图标。字符串为 IconString 类型(即 FxIcon 图标名,如 ep:editant-design:homesvg:xxxstringep:question-filled
icon-color图标颜色stringvar(--color-warning)
hide-icon是否隐藏图标booleanfalse
placement出现位置Placementbottom
width宽度string | number192
disabled是否禁用booleanfalse
show-arrow是否显示箭头booleantrue
teleported / persistentteleport / 持久化booleantrue
button-size按钮尺寸'small' | 'default' | 'large'
hide-after隐藏延时(ms)number200
visible (v-model:visible) ^(fx 增强)是否显示boolean
virtual-triggering是否启用虚拟触发booleanfalse
virtual-ref虚拟触发元素,配合 virtual-triggeringMeasurable

Slots

名称说明
reference触发元素
actions自定义底部按钮区,作用域 { confirm, cancel }

Events

名称说明
confirm点击确认(参数 MouseEvent
cancel点击取消(参数 MouseEvent
update:visible ^(fx 增强)显隐变化

实现说明

  • 浮层引擎基于 @floating-ui/dom
  • v-model:visibledisabled / placement / offset / show-arrow / show-after / popper-class / popper-style / button-size 为 fx 扩展能力
  • 图标走 @fx-core/icon,样式走 @fx/styles token