Started testing Electron
This commit is contained in:
parent
11cd8708d9
commit
bf74527b47
2 changed files with 18 additions and 1 deletions
|
|
@ -4,10 +4,12 @@
|
|||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build"
|
||||
"build": "vue-cli-service build",
|
||||
"dev": "set NODE_ENV=DEV && electron src/app.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.18.0",
|
||||
"electron": "^4.0.5",
|
||||
"uikit": "^3.0.2",
|
||||
"vue": "^2.5.21",
|
||||
"vuex": "^3.0.1"
|
||||
|
|
|
|||
15
src/app.js
Normal file
15
src/app.js
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
const electron = require('electron')
|
||||
const app = electron.app
|
||||
const BrowserWindow = electron.BrowserWindow
|
||||
|
||||
let url
|
||||
if (process.env.NODE_ENV === 'DEV') {
|
||||
url = 'http://localhost:8080/'
|
||||
} else {
|
||||
url = `file://${process.cwd()}/dist/index.html`
|
||||
}
|
||||
|
||||
app.on('ready', () => {
|
||||
let window = new BrowserWindow({width: 800, height: 600})
|
||||
window.loadURL(url)
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue