electron
npm命令安装electron库
npm install electron --save-dev --save-exact
使用一个github的仓库模拟应用
git clone https://github.com/electron/electron-quick-start
cd electron-quick-start
npm install
npm start
electron API(文档库)
git clone https://github.com/fuchao2012/zh-cn-Electron-API-Demos
cd zh-cn-Electron-API-Demos
npm install
npm start
不使用require
mainWindow = new BrowserWindow({width: 1280, height: 1024, webPreferences: {
nodeIntegration: false
}})
##打包
npm install --save-dev electron-packager
打包命令
electron-packager <location of project> <name of project> <platform> <architecture> <electron version> <optional options>
命令说明:
* location of project:项目所在路径
* name of project:打包的项目名字
* platform:确定了你要构建哪个平台的应用(Windows、Mac 还是 Linux)
* architecture:决定了使用 x86 还是 x64 还是两个架构都用
* electron version:electron 的版本
* optional options:可选选项
API
api文档
git clone https://github.com/fuchao2012/zh-cn-Electron-API-Demos
cd zh-cn-Electron-API-Demos
npm install
npm satrt