chore: upate

This commit is contained in:
草鞋没号
2020-08-31 09:50:57 +08:00
parent 278a3468d2
commit 79cd832cfc
11 changed files with 45 additions and 12 deletions

View File

@@ -15,11 +15,14 @@ function createWin() {
win = new BrowserWindow({
width: 1024,
height: 768,
webPreferences: {
nodeIntegration: true,
},
})
const URL = is_dev
? `http://localhost:${process.env.PORT}` // vite 启动的服务器地址
: `file://${join(__dirname, '../render/dist/index.html')}` // vite 构建后的静态文件地址
: `file://${join(__dirname, '../../dist/render/index.html')}` // vite 构建后的静态文件地址
win.loadURL(URL)
}

5
src/main/preload.js Normal file
View File

@@ -0,0 +1,5 @@
const { ipcRenderer } = require('electron')
window.stopLoading = function() {
ipcRenderer.send('stop-loading-main')
}