add main.tsx

This commit is contained in:
zhandouxiaojiji committed 2020-10-09 19:11:37 +08:00
1 parent 09719f7788
commit ebbae1ae79
5 files changed
+931 -35

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
import { app, BrowserWindow, Menu, MenuItem, dialog } from 'electron';
let mainWindow: BrowserWindow = null;
let createWindow = function () {
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
// nodeIntegration: true
}
// fullscreenable:false,
// maximizable:false
})
mainWindow.webContents.openDevTools()
mainWindow.loadFile('index.html')
mainWindow.on('closed', function () {
mainWindow = null
})
}
app.on('ready', createWindow)
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', () => {
if (mainWindow === null) {
createWindow()
}
})