猿问

vue-router html5模式刷新出现404

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

阿晨1998
浏览 1374回答 1
1回答

冉冉说

这种问题不是应该RTFM吗……Router Options | vue-router documentation npm packagehistorydefault: falseEnables 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.
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答