VMenu 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. Generally not recommended except as a last resort: the default positioning algorithm should handle most scenarios better than is possible without teleporting, and you may have unexpected behavior if the menu ends up as child of its activator. | ||
close-delay | ||
Milliseconds to wait before closing component. Only works with the open-on-hover prop. | ||
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 | ||
Designates if menu should close when its content is clicked. | ||
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 | ||
将自定义的class应用于被分离的此元素。由于此元素的内容将被附加到v-app组件开头(除非你设置了attach属性),并且class属性不会将css类直接传递给组件,所以这个实行非常有用。 | ||
content-props | ||
Apply custom properties to the content. | ||
disabled | ||
移除组件的单击或 target 功能。 | ||
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 | ||
设定组件的高度。 | ||
id | ||
The unique identifier of 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 | ||
设定组件的最大高度。 | ||
max-width | ||
设定组件的最大宽度。 | ||
min-height | ||
设定组件的最小高度。 | ||
min-width | ||
Sets the minimum width for the component. Use auto to use the activator width. | ||
model-value | ||
组件 v-mode 的值。如果组件支持多属性,默认为空数组。 | ||
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 | ||
设置遮罩层的透明度。 | ||
open-delay | ||
Milliseconds to wait before opening component. Only works with the open-on-hover prop. | ||
open-on-click | ||
Designates whether menu should open on activator click. | ||
open-on-focus | ||
Activate the component when the activator is focused. | ||
open-on-hover | ||
Designates whether menu should open on activator hover. | ||
origin | ||
设置元素上的动画原点。您可以在 MDN 文档上浏览更多 for transition origin | ||
persistent | ||
Clicking outside of the element or pressing esc key will not deactivate it. | ||
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. | ||
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 | ||
设定组件的宽度。 | ||
z-index | ||
The z-index used for the component. |
事件
名称 | 类型 |
---|---|
update:modelValue | |
当组件的 model-value 更改时引发的事件。 |
插槽
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 |
默认Vue 插槽。 |
可用属性
activatorEl |
MISSING DESCRIPTION (edit in github ) |
animateClick |
MISSING DESCRIPTION (edit in github ) |
contentEl |
MISSING DESCRIPTION (edit in github ) |
globalTop |
MISSING DESCRIPTION (edit in github ) |
id |
MISSING DESCRIPTION (edit in github ) |
localTop |
MISSING DESCRIPTION (edit in github ) |
scrimEl |
MISSING DESCRIPTION (edit in github ) |
updateLocation |
MISSING DESCRIPTION (edit in github ) |
SASS 变量
名称 | 默认值 |
---|---|
$menu-content-border-radius | |
$menu-elevation | |