Skip to content

Popover弹出框

基础用法

通过 trigger 插槽和 content 插槽来定义触发器和弹出内容

设置trigger

可选值有 hoverclick,默认为 hover

设置位置

可选值有 top, top-start, top-end, bottom, bottom-start, bottom-end, left, left-start, left-end, right, right-start, right-end,默认为 bottom

API

Attributes

Props

属性值说明类型具体类型默认值
position对齐位置enum['top','top-start','top-end','bottom','bottom-start','bottom-end','left','left-start','left-end','right','right-start','right-end']bottom
trigger触发时机enum['hover','click']click
offset偏移距离(px)number-8
close-on-click-outside点击外部关闭弹出框boolean-true
close-on-escapeesc关闭弹出框boolean-true
z-indexz-index值number-0

Event

名称说明具体类型
show弹出框显示时() => void
hide弹出框隐藏时() => void
toggle弹出框状态切换(visible: boolean) => void

Expose

方法名说明类型
show显示弹出框() => void
hide隐藏弹出框() => void
toggle切换弹出框状态() => void
visible弹出框状态值ComputedRef<boolean>

Slots

名称说明
trigger触发器内容
content弹出框内容