和老师配置一样,直接访问localhost:port/app之后页面出现Cannot GET /app
来源:4-1 Vue-router之集成

慕粉2125012034
2020-03-24
router配置
访问提示
请问老师该怎么解决?
写回答
1回答
-
慕粉2125012034
提问者
2020-03-24
解决了,devServer中要配置historyApiFallback
const devServer = {
port: 8999,
host: '0.0.0.0',
overlay: {
errors: true// 有错误直接显示在网页上
},
hot: true, // 局部热加载
historyApiFallback: {
index: '/index.html'
}
}
112020-03-25
相似问题