赞
踩
1.创建文件夹deskapp,将vue项目打包后的dist文件夹重命名为App并放入deskapp目录中。
2.在deskapp目录中新建package.json文件,package.json中内容如下:
- {
- "name": "deskapp",
- "version": "1.0.0",
- "description": "",
- "main": "App/index.html",
- "window": {
- "title": "桌面应用",
- "icon": "",
- "width": 1366,
- "height": 768,
- "toolbar": false,
- "frame": true,
- "resizable": true,
- "position": "center",
- "transparent": false,
- "show": true
- },
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1",
- "dist": "build --tasks win-x86,win-x64 --mirror https://npm.taobao.org/mirrors/nwjs/ .",
- "start": "run --x86 --mirror https://npm.taobao.org/mirrors/nwjs/ ."
- },
- "author": "",
- "license": "ISC",
- "devDependencies": {
- "nwjs-builder-phoenix": "^1.15.0"
- },
- "build": {
- "nwVersion": "0.27.5"
- }
- }

3.在deskapp目录中打开cmd,执行以下两个指令
- npm install
- npm run dist
执行以上三步操作后,打开dist目录,dist中有两个文件,其中x64就是打包好的桌面应用。
4.打开文件夹,找到对应exe后缀结尾的文件,双击即可打开应用
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。