Skip to content

BasePopper 基础浮窗

基本用法

不同的触发方式

纯手动控制

两种内置主题

API

BasePopper Props

参数名说明类型可选值默认值必填
modelValuev-model 绑定值boolean/nullnull
maxWidth最大宽度string/number300
theme主题色(黑/白)stringdark/lightdark
contentpopper 内容,也可以通过 slot="content" 传入string
titlepopper 标题string
placement弹出位置stringtop/top-start/top-end/right/right-start/right-end/bottom/bottom-start/bottom-end/left/left-start/left-end/auto/auto-start/auto-endtop
disabled是否禁用booleanfalse
offset距离触发器的距离[x, y][0, 10]
delay显示/隐藏的延迟[show, hide][0, 0]
trigger触发的方式string'mouseenter focus'/'mouseenter click'/click/mouseenter/focusin/manualmouseenter
arrow是否显示箭头booleantrue
zIndex同 CSS 属性 z-indexnumber
customClass自定义类名string
customTriggerClass自定义触发器(reference)的 classstring/object
customDropdownClass自定义下拉菜单的 classstring/object
sameWidth下拉菜单的宽度是否和触发器(reference)相同booleanfalse
appendTo浮框挂载到的元素Element / 'parent' / ((ref: Element) => Element)'parent'

BasePopper Events

事件名说明回调参数
show浮窗打开时触发(instance: VueTippy) => void
hide浮窗关闭时触发(instance: VueTippy) => void
clickOutside点击浮窗外部区域时触发(instance: VueTippy) => void
mount浮窗挂载完成时触发(instance: VueTippy) => void

BasePopper Slots

插槽名说明子标签
default默认插槽
content自定义浮窗内部的内容(也可直接通过prop=content传入