Skip to main content

Menu

Extends Component

Implements CloseableComponent

Constructor

constructor();

Methods

setNoIcon

setNoIcon(): this;

setUseNativeMenu

setUseNativeMenu(useNativeMenu: boolean): this;

Force this menu to use native or DOM. (Only works on the desktop app)

addItem

addItem(cb: (item: MenuItem) => any): this;

Adds a menu item. Only works when menu is not shown yet.

addSeparator

addSeparator(): this;

Adds a separator. Only works when menu is not shown yet.

showAtMouseEvent

showAtMouseEvent(evt: MouseEvent): this;

showAtPosition

showAtPosition(position: MenuPositionDef, doc?: Document): this;

hide

hide(): this;

close

close(): void;

onHide

onHide(callback: () => any): void;