Skip to content
On this page

VMenu

Base class for menu

Props

NameTypeDescription
anchorEnum:
string
HTMLElement
ID or direct reference to the component's anchor element.
aria-currentEnum:
page
step
location
date
time
true
false
Indicates the element that represents the current item within a container or set of related elements.
aria-labelstring
placementEnum:
top
right
bottom
left
top-start
top-end
right-start
right-end
bottom-start
bottom-end
left-start
left-end
placement of the menu
auto-dismissbooleanindicates whether the menu will automatically close when the user clicks outside the menu
openbooleanindicates whether the menu is open

Events

NameEvent TypeDescription
clickMouseEventFires when a pointing device button (such as a mouse's primary mouse button) is both pressed and released while the pointer is located inside the element.
focusFocusEventFires when the element receives focus.
blurFocusEventFires when the element loses focus.
keydownKeyboardEventFires when a key is pressed.
keyupKeyboardEventFires when a key is released.
inputEventFires when the value of an element has been changed.
openunknownFired when the menu is opened
closeunknownFired when the menu is closed

Slots

NameDescription
defaultDefault slot.
anchorUsed to set the anchor element for the menu.
headerUsed to add additional content to the top of the menu.
action-itemsUsed to add action items to the bottom of the menu.

Methods

NameTypeDescription
focus() => voidFocuses the first item in the menu.
collapseExpandedItem() => voidCollapses any expanded menu items.
autoDismissChanged(oldValue: boolean) => unknown
openChanged(_: boolean,newValue: boolean) => void