第一步在项目根目录:创建vue.config.js文件,代码如下
Snipaste_2020-09-14_11-54-30.png
在路由下,router/index.js,注释掉mode:'history',就可以了
Snipaste_2020-09-14_11-57-18.png
第三步:在cmd 输入的指令**npm run build//
//在cmd 输入的指令**npm run build**
//yarn指令:yarn build
D:\学习资料\实战项目\第六天\xuex> npm run build
> xuex@0.1.0 build D:\学习资料\实战项目\第六天\xuex
> vue-cli-service build
/ Building for production...
DONE Compiled successfully in 6755ms 11:14:36
File Size Gzipped
dist\js\chunk-vendors.b3a8524b.js 138.58 KiB 47.90 KiB
dist\js\app.b0878e9f.js 3.86 KiB 1.85 KiB
dist\js\about.2d2eea7c.js 0.34 KiB 0.27 KiB
dist\css\app.b0aefef5.css 0.25 KiB 0.19 KiB
Images and other types of assets omitted.
DONE Build complete. The dist directory is ready to be deployed.
INFO Check out deployment instructions at https://cli.vuejs.org/guide/deployment.html