exportasyncfunctionmenu() { // If a window was not created with an explicit menu or had one set explicitly, // this menu will be assigned to it. const menu = awaitMenu.new({ items: [ { id: 'file', text: '文件(F)', items: [ { id: 'open', text: '打开', } ] }, { id: 'select', text: '选择', }, ], });
menu.setAsAppMenu().then((res) => { console.log('menu set success', res); }); }
exportasyncfunctionmenu() { // If a window was not created with an explicit menu or had one set explicitly, // this menu will be assigned to it. const menu = awaitMenu.new({ items: [ { id: 'file', text: '文件(F)', items: [ { id: 'open', text: '打开', } ] }, { id: 'select', text: '选择', items: [] }, ], });
menu.setAsAppMenu().then((res) => { console.log('menu set success', res); }); }