Skip to content

Commit 7099a96

Browse files
committed
init
0 parents  commit 7099a96

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+7987
-0
lines changed

.babelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"presets": ["es2015", "stage-0"],
3+
"plugins": ["transform-runtime"]
4+
}

.eslintignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
app/node_modules/**
2+
app/dist/**
3+
app/electron.js
4+
test/unit/coverage/**
5+
test/unit/*.js
6+
test/e2e/*.js

.eslintrc.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module.exports = {
2+
root: true,
3+
parser: 'babel-eslint',
4+
parserOptions: {
5+
sourceType: 'module'
6+
},
7+
env: {
8+
browser: true,
9+
node: true
10+
},
11+
extends: 'airbnb-base',
12+
plugins: [
13+
'html'
14+
],
15+
'rules': {
16+
'global-require': 0,
17+
'import/no-unresolved': 0,
18+
'no-param-reassign': 0,
19+
'no-shadow': 0,
20+
// allow debugger during development
21+
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
22+
}
23+
}

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.DS_Store
2+
app/dist/index.html
3+
app/dist/build.js
4+
app/dist/styles.css
5+
builds/*
6+
coverage
7+
node_modules
8+
npm-debug.log
9+
npm-debug.log.*
10+
thumbs.db
11+
!.gitkeep

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// 將您的設定放入此檔案中以覆寫預設值和使用者設定。
2+
{
3+
"editor.tabSize": 2,
4+
"files.associations": {
5+
"*.vue": "vue"
6+
}
7+
}

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# electron-vue-browser
2+
3+
> An electron-vue based browser
4+
5+
## Build Setup
6+
7+
``` bash
8+
# install dependencies
9+
npm install
10+
11+
# serve with hot reload at localhost:9080
12+
npm run dev
13+
14+
# build electron app for production
15+
npm run build
16+
17+
# lint all JS/Vue component files in `app/src`
18+
npm run lint
19+
20+
# run webpack in production
21+
npm run pack
22+
```
23+
24+
More information can be found [here](https://simulatedgreg.gitbooks.io/electron-vue/content/docs/npm_scripts.html).
25+
26+
---
27+
28+
This project was generated from [electron-vue](https://github.com/SimulatedGREG/electron-vue) using [vue-cli](https://github.com/vuejs/vue-cli). Documentation about this project can be found [here](https://simulatedgreg.gitbooks.io/electron-vue/content/index.html).

app/dist/.gitkeep

Whitespace-only changes.

app/electron.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
'use strict'
2+
3+
const electron = require('electron')
4+
const path = require('path')
5+
const app = electron.app
6+
const BrowserWindow = electron.BrowserWindow
7+
8+
let mainWindow
9+
let config = {}
10+
11+
if (process.env.NODE_ENV === 'development') {
12+
config = require('../config')
13+
config.url = `http://localhost:${config.port}`
14+
} else {
15+
config.devtron = false
16+
config.url = `file://${__dirname}/dist/index.html`
17+
}
18+
19+
function createWindow () {
20+
/**
21+
* Initial window options
22+
*/
23+
mainWindow = new BrowserWindow({
24+
height: 720,
25+
width: 1080,
26+
minWidth: 320,
27+
minHeight: 500,
28+
frame: false,
29+
})
30+
31+
mainWindow.loadURL(config.url)
32+
33+
if (process.env.NODE_ENV === 'development') {
34+
BrowserWindow.addDevToolsExtension(path.join(__dirname, '../node_modules/devtron'))
35+
36+
let installExtension = require('electron-devtools-installer')
37+
38+
installExtension.default(installExtension.VUEJS_DEVTOOLS)
39+
.then((name) => mainWindow.webContents.openDevTools())
40+
.catch((err) => console.log('An error occurred: ', err))
41+
}
42+
43+
mainWindow.on('closed', () => {
44+
mainWindow = null
45+
})
46+
47+
console.log('mainWindow opened')
48+
}
49+
50+
app.on('ready', createWindow)
51+
52+
app.on('window-all-closed', () => {
53+
if (process.platform !== 'darwin') {
54+
app.quit()
55+
}
56+
})
57+
58+
app.on('activate', () => {
59+
if (mainWindow === null) {
60+
createWindow()
61+
}
62+
})

app/icons/icon.icns

490 KB
Binary file not shown.

app/icons/icon.ico

257 KB
Binary file not shown.

0 commit comments

Comments
 (0)