Skip to content

ElectronMenu.buildFromTemplate method

ElectronMenu › buildFromTemplate

Unofficial

Generally, the template is an array of options for constructing a menu item.

You can also attach other fields to the elements of the template and they will become properties of the constructed menu items.

Signature:

buildFromTemplate(template: (ElectronMenuItem | ElectronMenuItemConstructorOptions)[]): ElectronMenu

Parameters:

Parameter Type Description
template (ElectronMenuItem | ElectronMenuItemConstructorOptions)[] The template describing the menu items.

Returns: ElectronMenuThe constructed menu.