Skip to content

VDialog API

组件页面

属性

名称类型默认值
absolute
Applies position: absolute to the content element.
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
Milliseconds to wait before closing component. Only applies to hover and focus events.
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.
fullscreen
Changes layout for fullscreen display.
height
Sets the height for the component.
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 a v-dialog’s content 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
Milliseconds to wait before opening component. Only applies to hover and focus events.
open-on-click
Activate the component when the activator is clicked.
open-on-focus
Activate the component when the activator is focused.
open-on-hover
Designates whether component should activate when its activator is hovered.
origin
Sets the transition origin on the element. You can find more information on the MDN documentation for transition origin .
persistent
Clicking outside of the element or pressing esc key will not deactivate it.
retain-focus
Tab focus will return to the first child of the dialog by default. Disable this when using external tools that require focus such as TinyMCE or vue-clipboard.
scrim
Accepts true/false to enable background, and string to define color.
scroll-strategy
Strategy used when the component is activate and user scrolls.
scrollable
When set to true, expects a v-card and a v-card-text component with a designated height. For more information, check out the scrollable example .
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.
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.

事件

名称类型
afterLeave
Event that fires after the overlay has finished transitioning out.
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 the component and the persistent prop is used.
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 (edit in github )
updateLocation
Function used for locationStrategy positioning.

SASS 变量

名称默认值
$dialog-border-radius
$dialog-card-actions-justify
$dialog-card-header-padding
$dialog-card-header-text-padding-top
$dialog-card-text-letter-spacing
$dialog-card-text-padding
$dialog-elevation
$dialog-margin