VueRouter报错This application has no explicit mapping for /error, so you are seeing this as a fallback

站点发布到Web服务器上,刷新报如上错。

原因:与 Vue Router3 的 mode 配置有关,默认是 hash 模式,配置成 history 模式。开发环境没问题,但发布出现的。

官网说明: 详见此处

解决:

方案一:屏蔽即可,默认就是 hash 模式。

方案二:如果还是要用 history 模式,需设置 Web服务器,详见此处

猜你喜欢

转载自blog.csdn.net/sinat_31213021/article/details/132104579