vue-router配置後地址欄輸入跳轉不成功問題

在起服務的js中增加 connect-history-api-fallback 

const history = require('connect-history-api-fallback');

// 在靜態頁面之前,這一句:app.use('/static', express.static(__dirname + '/public'))之前設置history
const historyConfig = {
  index: '/index.html'
};
app.use(history(historyConfig));

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章