We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[vue] 如果vue-router使用history模式,部署时要注意什么?
The text was updated successfully, but these errors were encountered:
服务器的404页面需要重定向到index.html
Sorry, something went wrong.
nginx try_files $uri $uri/ /index.html;
try_files $uri $uri/ /index.html;
vue应用为SPA,hash模式下,改变hash值,网络请求地址不会变,刷新url或者改变url不会出现404问题。 history模式,如果刷新url或改变url,网络请求的地址不存在,因为vue应用实际只有一个html,找不到会出现404错误。 解决办法,将所有的网络请求全部指向根页面,就不会出现404了,也即上面给出的答案。
No branches or pull requests
[vue] 如果vue-router使用history模式,部署时要注意什么?
The text was updated successfully, but these errors were encountered: