1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

[门禁端] 创建项目

This commit is contained in:
2022-11-28 15:22:56 +08:00
parent 5f142254f2
commit 42e3952b83
8 changed files with 161 additions and 18 deletions

View File

@@ -0,0 +1,31 @@
const { app, BrowserWindow } = require('electron')
const { platform } = require('node:process')
const path = require('path')
console.log(`This platform is ${platform}`);
const createWindow = () => {
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
preload: path.join(__dirname, 'preload.js')
},
})
mainWindow.loadFile('html/index.html')
mainWindow.webContents.openDevTools()
}
app.whenReady().then(() => {
createWindow()
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') app.quit()
})