-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
43 lines (32 loc) · 770 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const path = require('path')
const url = require('url')
const { app, BrowserWindow, Menu } = require('electron')
let win
// process.env.NODE_ENV = 'production'
app.on('ready', () => {
// create window
win = new BrowserWindow({
width: 1400,
height: 900
})
// render file
win.loadURL(url.format({
pathname: path.join(__dirname, '/index.html'),
prorocol: 'file:',
slashes: true
}))
// close window
win.on('closed', () => {
win = null
})
// const mainMenu = Menu.buildFromTemplate(mainMenuTemplate)
// Menu.setApplicationMenu(mainMenu)
})
// const mainMenuTemplate = [
// {
// label: 'File'
// }
// ]
app.on('window-all-closed', () => {
app.quit()
})