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