更新记录
1.0.0(2021-04-07) 下载此版本
发布项目
平台兼容性
桌面端跨平台开发框架Electron(v12.0),集成vue(v2.6.11)框架uni-app
Electron: http://www.electronjs.org/
Electron: v12.0
node: v12.21
vue: v2.6.11
1、打开webstorm导入项目,在terminal中运行
yarn
important:为了避免npm install失败,请使用yarn(不用另外配置镜像,项目中已配置源.yarnrc)
2、安装后,执行命令即可运行:
"serve:uni": "npm run dev:h5",
"electron:build-mac": "vue-cli-service electron:build -p never -m",
"electron:build-win": "vue-cli-service electron:build -p never -w",
"electron:build-linux": "vue-cli-service electron:build -p never -l",
"electron:serve": "vue-cli-service electron:serve",
3、在src目录写你的代码、或直接将现有项目文件复制、覆盖
需保留/src/background.js、src/electron
本人使用webstorm,hbuilderx请自行测试
项目目录
打包输出目录
配置文件中的一些变量名看明白了再改,不然可能运行不起来
package.json中的dependencies去除了小程序兼容的包,有需要的请自行添加:
"dependencies": {
"@dcloudio/uni-app-plus": "^2.0.0-31420210305001",
"@dcloudio/uni-h5": "^2.0.0-31420210305001",
"@dcloudio/uni-helper-json": "*",
"@dcloudio/uni-mp-alipay": "^2.0.0-31420210305001",
"@dcloudio/uni-mp-baidu": "^2.0.0-31420210305001",
"@dcloudio/uni-mp-qq": "^2.0.0-31420210305001",
"@dcloudio/uni-mp-toutiao": "^2.0.0-31420210305001",
"@dcloudio/uni-mp-weixin": "^2.0.0-31420210305001",
"@dcloudio/uni-stat": "^2.0.0-31420210305001",
... 略
}
"devDependencies": {
"@dcloudio/uni-cli-shared": "^2.0.0-31420210305001",
"@dcloudio/uni-migration": "^2.0.0-31420210305001",
"@dcloudio/uni-template-compiler": "^2.0.0-31420210305001",
"@dcloudio/vue-cli-plugin-hbuilderx": "^2.0.0-31420210305001",
"@dcloudio/vue-cli-plugin-uni": "^2.0.0-31420210305001",
"@dcloudio/vue-cli-plugin-uni-optimize": "^2.0.0-31420210305001",
"@dcloudio/webpack-uni-mp-loader": "^2.0.0-31420210305001",
"@dcloudio/webpack-uni-pages-loader": "^2.0.0-31420210305001",
"@types/html5plus": "^1.0.1",
"@types/uni-app": "^1.4.3",
... 略
}