Vue路由History mode模式中页面无法渲染的原因及解决

直入主题

修改mode之后,链接就不需要带#号了

const router = new VueRouter({
  mode: 'history',
  routes: [...]
})

nginx配置

location /wx/ {
  try_files $uri $uri/ /wx/index.html;
}

 

发布了109 篇原创文章 · 获赞 27 · 访问量 20万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章