How to package the vue project into a computer desktop application

1. Create a folder deskapp, rename the packaged dist folder of the vue project to App and put it in the deskapp directory.

2. Create a new package.json file in the deskapp directory, and the contents of package.json are as follows:

{
"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. Open cmd in the deskapp directory and execute the following two commands

npm install
npm run dist

After performing the above three steps, open the dist directory. There are two files in the dist, among which x64 is the packaged desktop application.

おすすめ

転載: blog.csdn.net/weixin_44594219/article/details/127211190