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


在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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM