目录

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.

ParameterTypeDescription
optionsMenuItemBaseOptionsThe options for constructing the menu item.

setLabel() 

setLabel(label: string): void;

Sets the label of the menu item.

ParameterTypeDescription
labelstringThe label of the menu item.

setEnabled() 

setEnabled(enabled: boolean): void;

Sets whether the menu item is enabled.

ParameterTypeDescription
enabledbooleanWhether the menu item is enabled.