Menu
ContextMenu
The menu a right-click or the context-menu key opens, at the pointer or under the focused element, with submenus.
WAI-ARIA tested
Import
main.ts
import { ContextMenu } from '@vitral/vue';On an element
report.pdf
Right-click it, or focus it and press Shift+F10. Last command: —API
Read from packages/vue/src/components/ContextMenu/types.ts, so it says what the component actually accepts.
Props
| Name | Type | Description |
|---|---|---|
| model | MenuItem[] | The items; an item's `items` open as a submenu beside it. |
| global | boolean | Open on a right-click (or Shift+F10) anywhere in the page. |
| target | string | HTMLElement | null | Open on a right-click, Shift+F10 or the context-menu key on this element, or on the element a selector finds. |
| appendTo | string | Where it renders: `'body'` (the default) or a selector. |
| ariaLabel | string | Names the menu. |
Plus pt, dt and unstyled from BaseProps, see pass-through and unstyled mode.
Emits
| Event | Payload | Description |
|---|---|---|
| show | — | — |
| hide | — | — |
Slots
| Name | Slot props | Description |
|---|---|---|
| item | (props: NestedMenuItemSlotProps) | An item's content. The menuitem element around it, with its role and keyboard, stays. |