Skip to content

VTooltip API

组件页面

属性

名称类型默认值
activator
Explicitly sets the overlay’s activator.
activator-props
Apply custom properties to the activator.
attach
Specifies which DOM element the overlay content should teleport to. Can be a direct element reference, querySelector string, or true to disable teleporting. Uses body by default.
close-delay
Delay (in ms) after which menu closes (when open-on-hover prop is set to true).
close-on-back
Closes the overlay content when the browser’s back button is pressed or $router.back() is called, cancelling the original navigation. persistent overlays will cancel navigation and animate as if they were clicked outside instead of closing.
close-on-content-click
Closes component when you click on its content.
contained
Limits the size of the component and scrim to its offset parent. Implies absolute and attach. (Note: The parent element must have position: relative.).
content-class
Applies a custom class to the detached element. This is useful because the content is moved to the beginning of the v-app component (unless the attach prop is provided) and is not targetable by classes passed directly on the component.
content-props
Apply custom properties to the content.
disabled
Removes the ability to click or target the component.
eager
Forces the component’s content to render when it mounts. This is useful if you have content that will not be rendered in the DOM that you want crawled for SEO.
height
Sets the height for the component.
id
HTML id attribute of the tooltip overlay. If not set, a globally unique id will be used.
location
Specifies the anchor point for positioning the component, using directional cues to align it either horizontally, vertically, or both…
location-strategy
A function used to specifies how the component should position relative to its activator.
max-height
Sets the maximum height for the component.
max-width
Sets the maximum width for the component.
min-height
Sets the minimum height for the component.
min-width
Sets the minimum width for the component.
model-value
The v-model value of the component. If component supports the multiple prop, this defaults to an empty array.
no-click-animation
Disables the bounce effect when clicking outside of the content element when using the persistent prop.
offset
A single value that offsets content away from the target based upon what side it is on.
opacity
Sets the overlay opacity.
open-delay
Delay (in ms) after which tooltip opens (when open-on-hover prop is set to true).
open-on-click
Designates whether the tooltip should open on activator click.
open-on-focus
Activate the component when the activator is focused.
open-on-hover
Designates whether the tooltip should open on activator hover.
origin
Sets the transition origin on the element. You can find more information on the MDN documentation for transition origin .
scrim
Accepts true/false to enable background, and string to define color.
scroll-strategy
Strategy used when the component is activate and user scrolls.
target
For locationStrategy=“connected”, specify an element or array of x,y coordinates that the overlay should position itself relative to. This will be the activator element by default.
text
Specify content text for the component.
theme
Specify a theme for this component and all of its children.
transition
Sets the component transition. Can be one of the built in or custom transition.
width
Sets the width for the component.
z-index
The z-index used for the component.

事件

名称类型
update:modelValue
Event that is emitted when the component’s model changes.

插槽

activator
When used, will activate the component when clicked (or hover for specific components). This manually stops the event propagation. Without this slot, if you open the component through its model, you will need to manually stop the event propagation.
default
The default Vue slot.

可用属性

activatorEl
Ref to the current activator element.
animateClick
Function invoked when user clicks outside.
contentEl
Ref to the current content element.
globalTop
Used by activator to determine a components position in the global stack order.
localTop
Used by activator to determine a components position in the local stack order.
scrimEl
MISSING DESCRIPTION
updateLocation
Function used for locationStrategy positioning.

SASS 变量

名称默认值
$tooltip-background-color
$tooltip-border-radius
$tooltip-font-size
$tooltip-line-height
$tooltip-overflow-wrap
$tooltip-padding
$tooltip-text-color
$tooltip-transition-enter-duration
$tooltip-transition-leave-duration