首页 > 其他 > 详细

处理 vue history模式打包后页面为空白页的问题

时间:2020-05-22 10:42:48      阅读:155      评论:0      收藏:0      [点我收藏+]

在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 /;
}

转载至 http://www.gzui.net/archives/3234

 

处理 vue history模式打包后页面为空白页的问题

原文:https://www.cnblogs.com/ronle/p/12935588.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!