VMenu
Props
Name | Type | Description |
---|---|---|
anchor | Enum: string HTMLElement | ID or direct reference to the component's anchor element. |
aria-current | Enum:page step location date time true false | Indicates the element that represents the current item within a container or set of related elements. |
aria-label | string | |
placement | Enum:top right bottom left top-start top-end right-start right-end bottom-start bottom-end left-start left-end | placement of the menu |
trigger | Enum:auto legacy off | Controls how the menu opens and closes itself. |
auto-dismiss | boolean | indicates whether the menu will automatically close when focus moves away from it. |
position-strategy | Enum:absolute fixed | The strategy-absolute attribute. |
open | boolean | indicates whether the menu is open |
Events
Name | Event Type | Description |
---|---|---|
click | MouseEvent | Fires 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. |
focus | FocusEvent | Fires when the element receives focus. |
blur | FocusEvent | Fires when the element loses focus. |
keydown | KeyboardEvent | Fires when a key is pressed. |
keyup | KeyboardEvent | Fires when a key is released. |
input | Event | Fires when the value of an element has been changed. |
open | CustomEvent<undefined> | Fired when the menu is opened |
close | CustomEvent<undefined> | Fired when the menu is closed |
Slots
Name | Description |
---|---|
default | Default slot. |
anchor | Used to set the anchor element for the menu. |
header | Used to add additional content to the top of the menu. |
action-items | Used to add action items to the bottom of the menu. |
Methods
Name | Type | Description |
---|---|---|
focus | () => void | Moves focus into the menu. If there is a child with the autofocus attribute, it will be focused. Otherwise, the first focusable child will be focused. |
collapseExpandedItem | () => void | Collapses any expanded Menu Items. |
openChanged | (_: boolean,newValue: boolean) => void |