1、修改 vue.config.js,
module.exports = {
// 根路径
publicPath: '/app',
......
}
2、修改 router/index.js,VueRouter中添加base
const router = new VueRouter({
mode: 'history',
base: 'app',
....
}
3、打包编译部署到nginx后,访问 localhost:8080/app即可
1、修改 vue.config.js,
module.exports = {
// 根路径
publicPath: '/app',
......
}
2、修改 router/index.js,VueRouter中添加base
const router = new VueRouter({
mode: 'history',
base: 'app',
....
}
3、打包编译部署到nginx后,访问 localhost:8080/app即可