electron-menu-loader
Loading menu manifest from seperated menu files, Supporting a delegate custom event for Menu click event
Install
$ npm install --save electron-menu-loader
Usage
// load manifest from a file'./menu';; // load manifest with paramsconst app = ; // load shared meny and specific menu of target platformlet menu = ;menuprocessplatform = ;menu; // manange menu click event in the single placeapp;
API
electronMenuLoader(manifest, [options])
manifest
Type: string
path of the file content with the sets of the menu items
options
appMenu
If it set with true? this will register a menu to application menu. default is true.
Events
menu loader
will convert event
property to custom event if the property is set in manifest like below. The custom event function translated is beging converted when the manifest has been loading.
module.exports = ;
When user click the Preferences
, the custom event will be fired to app
with the event named meuitem-click. See refer to below sample.
app;
License
MIT © Jimmy Moon