|
|
@@ -1,47 +1,47 @@
|
|
|
-import { app, BrowserWindow } from 'electron'
|
|
|
+import {app, BrowserWindow} from 'electron'
|
|
|
|
|
|
/**
|
|
|
* Set `__static` path to static files in production
|
|
|
* https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-static-assets.html
|
|
|
*/
|
|
|
if (process.env.NODE_ENV !== 'development') {
|
|
|
- global.__static = require('path').join(__dirname, '/static').replace(/\\/g, '\\\\')
|
|
|
+ global.__static = require('path').join(__dirname, '/static').replace(/\\/g, '\\\\')
|
|
|
}
|
|
|
|
|
|
let mainWindow
|
|
|
const winURL = process.env.NODE_ENV === 'development'
|
|
|
- ? `http://localhost:9080`
|
|
|
- : `file://${__dirname}/index.html`
|
|
|
+ ? `http://localhost:9080`
|
|
|
+ : `file://${__dirname}/index.html`
|
|
|
|
|
|
-function createWindow () {
|
|
|
- /**
|
|
|
- * Initial window options
|
|
|
- */
|
|
|
- mainWindow = new BrowserWindow({
|
|
|
- height: 563,
|
|
|
- useContentSize: true,
|
|
|
- width: 1000
|
|
|
- })
|
|
|
+function createWindow() {
|
|
|
+ /**
|
|
|
+ * Initial window options
|
|
|
+ */
|
|
|
+ mainWindow = new BrowserWindow({
|
|
|
+ height: 563,
|
|
|
+ useContentSize: true,
|
|
|
+ width: 1000
|
|
|
+ })
|
|
|
|
|
|
- mainWindow.loadURL(winURL)
|
|
|
+ mainWindow.loadURL(winURL)
|
|
|
|
|
|
- mainWindow.on('closed', () => {
|
|
|
- mainWindow = null
|
|
|
- })
|
|
|
+ mainWindow.on('closed', () => {
|
|
|
+ mainWindow = null
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
app.on('ready', createWindow)
|
|
|
|
|
|
app.on('window-all-closed', () => {
|
|
|
- if (process.platform !== 'darwin') {
|
|
|
- app.quit()
|
|
|
- }
|
|
|
+ if (process.platform !== 'darwin') {
|
|
|
+ app.quit()
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
app.on('activate', () => {
|
|
|
- if (mainWindow === null) {
|
|
|
- createWindow()
|
|
|
- }
|
|
|
+ if (mainWindow === null) {
|
|
|
+ createWindow()
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
/**
|