1 在vue根目录下创建vue.config.js 文件,内容如下
// product为工程名
module.exports = {
publicPath: '/product/',
outputDir: 'product'
}
2 修改router.js 文件
// product为工程名
const router = new VueRouter({
mode: 'history',
base: '/product/',
routes
})
3 联合后端同事,修改Nginx配置
// product为工程名
location /product {
index index.html index.htm;
try_files $uri $uri/ /product /;
}