MenuItemBase
Extends: MenuElement
A base class that implements the common functionality for all menu items.
Properties
id
readonly id: string;
The ID of the menu item.
label
readonly label?: string;
The label of the menu item.
enabled
readonly enabled?: boolean;
Whether the menu item is enabled.
action
readonly action?: (item: T) => void;
The action to perform when the menu item is clicked.
Methods
constructor()
constructor(options: MenuItemBaseOptions<T>): void;
Creates a new menu item.
| Parameter | Type | Description |
|---|---|---|
options | MenuItemBaseOptions | The options for constructing the menu item. |
setLabel()
setLabel(label: string): void;
Sets the label of the menu item.
| Parameter | Type | Description |
|---|---|---|
label | string | The label of the menu item. |
setEnabled()
setEnabled(enabled: boolean): void;
Sets whether the menu item is enabled.
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | Whether the menu item is enabled. |