Skip to content

Tooltip 文字提示

悬浮显示的文字提示,支持黑白两种样式、可自定义内容与显示位置。

基础用法

将需要提示的内容包裹在 c-tooltip 中,默认 theme="dark"placement="top"

主题风格(黑/白)

通过 theme 切换黑白主题。

显示位置(placement)

支持 top / right / bottom / left 四个方向。

自定义内容(插槽)

支持通过 #content 插槽自定义内容(可放图标、文本、任意节点)。

Props

属性名说明类型可选值默认值
content提示文本(优先级低于插槽 #contentstring
theme主题风格'dark' | 'light'darklightdark
placement显示位置'top' | 'right' | 'bottom' | 'left'toprightbottomlefttop
disabled是否禁用提示booleanfalse
showDelay显示延迟毫秒number80
hideDelay隐藏延迟毫秒number80

Events

事件名说明
show提示显示时触发
hide提示隐藏时触发

Slots

插槽名说明
content自定义提示内容,优先级高于 content 属性