Merge pull request #7552 from electron/fix-menu-docs
fix Menu API example
This commit is contained in:
commit
39aa740c88
1 changed files with 2 additions and 3 deletions
|
@ -16,7 +16,7 @@ An example of creating the application menu in the main process with the
|
||||||
simple template API:
|
simple template API:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const {Menu} = require('electron')
|
const {app, Menu} = require('electron')
|
||||||
|
|
||||||
const template = [
|
const template = [
|
||||||
{
|
{
|
||||||
|
@ -111,9 +111,8 @@ const template = [
|
||||||
]
|
]
|
||||||
|
|
||||||
if (process.platform === 'darwin') {
|
if (process.platform === 'darwin') {
|
||||||
const name = require('electron').remote.app.getName()
|
|
||||||
template.unshift({
|
template.unshift({
|
||||||
label: name,
|
label: app.getName(),
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
role: 'about'
|
role: 'about'
|
||||||
|
|
Loading…
Add table
Reference in a new issue