美文网首页
vue-router 二级域名使用

vue-router 二级域名使用

作者: web5 | 来源:发表于2020-03-05 15:50 被阅读0次

修改三个配置,具体操作日后有时间更新,不懂私聊

  1. router配置
const route = new Router({
  mode: 'history',
  base: '/doctor-html/',
  routes
})
  1. webpack配置,vue-cli配置
publicPath: config.publicPath,
  1. nginx配置
try_files $uri $uri/ /doctor-html/index.html;
  1. 代码部署路径
项目目录配置实例
项目路径web/doctor-html/index.html
nginx配置root指向 web/ 项目放在doctor-html,但是nginx指向web,url访问com/doctor-html就好了

参考链接 https://segmentfault.com/a/1190000015753352

相关文章

网友评论

      本文标题:vue-router 二级域名使用

      本文链接:https://www.haomeiwen.com/subject/iuefrhtx.html