1
0
mirror of https://github.com/PanJiaChen/electron-vue-admin.git synced 2025-04-05 19:41:41 +08:00
2017-09-04 15:09:06 +08:00

42 lines
747 B
JavaScript

'use strict'
import { app, BrowserWindow } from 'electron'
let mainWindow
const winURL = process.env.NODE_ENV === 'development'
? `http://localhost:${require('../../../config').port}`
: `file://${__dirname}/index.html`
function createWindow() {
/**
* Initial window options
*/
mainWindow = new BrowserWindow({
height: 600,
width: 800
})
mainWindow.loadURL(winURL)
mainWindow.on('closed', () => {
mainWindow = null
})
// eslint-disable-next-line no-console
console.log('mainWindow opened')
}
app.on('ready', createWindow)
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', () => {
if (mainWindow === null) {
createWindow()
}
})