{"size": 576, "ext": "js", "max_stars_repo_path": "electron/main/menu.js", "max_stars_repo_name": "Ywrby/JiLe", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "electron/main/menu.js", "max_issues_repo_name": "Ywrby/JiLe", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "electron/main/menu.js", "max_forks_repo_name": "Ywrby/JiLe", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 18.0, "max_line_length": 56, "alphanum_fraction": 0.4722222222}
const { Menu } = require('electron')
let menuTemplate = [
  {
    label: '文件',
    submenu: [
      {
        label: '新建文件',
        accelerator: 'ctrl+n',
        click: function () {
          console.log('ctrl+n')
        }
      },
      {
        label: '新建窗口',
        click: function () {
          console.log('new window')
        }
      }
    ]
  },
  {
    label: '编辑',
    submenu: [
      { label: '复制', role: 'copy' },
      { label: '截切', role: 'cut' }
    ]
  }
]

const menuBuilder = Menu.buildFromTemplate(menuTemplate)
Menu.setApplicationMenu(menuBuilder)
