为了账号安全,请及时绑定邮箱和手机立即绑定

vue-router html5模式刷新出现404

vue-router html5模式刷新出现404

阿晨1998 2018-09-13 13:22:01
如题,使用vue-router html5模式时,当我直接输入某页面具体的url或者刷新当前页面,都会出现404 not found 错误。请问该如何解决?(因哈希模式中含“#!”导致某些配置不可用,所以必须使用html5模式= =)
查看完整描述

1 回答

?
冉冉说

TA贡献1877条经验 获得超1个赞

这种问题不是应该RTFM吗……
Router Options | vue-router documentation npm package

history

  • default: false

Enables HTML5 history mode. Leverages history.pushState() and history.replaceState() for history management.

Note: when using the history mode, the server needs to be properly configured so that a user directly visiting a deep link on your site doesn't get a 404.


查看完整回答
反对 回复 2018-10-09
  • 1 回答
  • 0 关注
  • 1373 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信