Restructured electron app
This commit is contained in:
parent
1e0c3a09d2
commit
6e109cc066
2 changed files with 30 additions and 14 deletions
28
app.js
Normal file
28
app.js
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
const electron = require('electron')
|
||||
const contextMenu = require('electron-context-menu');
|
||||
const path = require('path')
|
||||
|
||||
const app = electron.app
|
||||
const BrowserWindow = electron.BrowserWindow
|
||||
|
||||
const isDev = (process.env.NODE_ENV === 'DEV');
|
||||
|
||||
let url = `file://${path.join(__dirname, '/dist/index.html')}`
|
||||
|
||||
app.on('ready', () => {
|
||||
let window = new BrowserWindow({
|
||||
width: 1124,
|
||||
height: 800,
|
||||
icon: path.join(__dirname, '/src/assets/icons/png/64x64.png')
|
||||
})
|
||||
|
||||
window.setMenu(null);
|
||||
|
||||
contextMenu({
|
||||
showCopyImageAddress: true,
|
||||
showSaveImageAs: true,
|
||||
showInspectElement: isDev,
|
||||
});
|
||||
|
||||
window.loadURL(url)
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue