electron-template项目用于作为客户端开的模版。
仅仅使用JavaScript,HTML以及CSS
Electron: 1.7.5
Node: 7.9.0
Chromium: 58.0.3029.110
V8:5.8.283.38
- git
- node.js
- node-gyp(全局安装)
- python(需要配置环境变量)
- 翻墙工具
# Clone the Quick Start repository
$ git clone -b develop http://192.168.9.66/Juzix-ethereum/electron-template
# Go into the repository
$ cd electron-template
# Install the dependencies and run
$ npm install&&npm run dev
但是如果有小伙伴没翻墙,被拦在的寡妇网内,会npm install导致失败,那就用下面这个办法吧(换了源也不好使的话)
用 淘宝的镜像安装
用了cnpm 安装依赖后, 打包会有问题, 打包会有问题, 打包会有问题, 找不到依赖的路径!!!
//main.js
ipcMain.on('asynchronous-message', (event, arg) => {
console.log(arg); // prints "ping"
event.sender.send('asynchronous-reply', 'pong');
});
ipcMain.on('synchronous-message', (event, arg) => {
console.log(arg); // prints "ping"
event.returnValue = 'pong';
});
const {ipcRenderer} = require('electron');
console.log(ipcRenderer.sendSync('synchronous-message', 'ping'));
ipcRenderer.on('asynchronous-reply', (event, arg) => {
console.log(arg); // prints "pong"
});
ipcRenderer.send('asynchronous-message', 'ping');
-
electron官网
https://electron.atom.io/ -
electron中文文档
https://github.com/electron/electron/tree/1-6-x/docs-translations/zh-CN
# install dependencies
npm install
# serve with hot reload at localhost:9080
npm run dev
# build electron application for production
npm run build