This commit is contained in:
hocili
2021-03-09 14:59:24 +08:00
commit 801eb88b11
16 changed files with 2547 additions and 0 deletions

33
src/main/app.ts Normal file
View File

@@ -0,0 +1,33 @@
import { app, BrowserWindow } from 'electron'
function createWindow() {
const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
if (process.env.NODE_ENV === 'development') {
win.loadURL('http://localhost:3000/')
} else {
win.loadFile('dist/render/index.html')
}
}
app.whenReady().then(createWindow)
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})