-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
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
browserHistory 如何在开发环境和生成环境下使用? #180
Comments
用browserHistory后, 需要服务器配置泛路由, 把所有路由都指向到index.html文件 |
请教 @lincenying @sorrycc |
请问有教程或者demo么 求一份 谢谢@lincenying @sorrycc |
开发模式下用 dora-plugin-browser-history,记得指定 index 。 生成环境需要服务端支持,配 nginx 或者在服务端(比如 node)批量处理路由,例子:https://github.com/sorrycc/dva-boilerplate-isomorphic/blob/master/server/server.js#L22 |
works like a charm ✌️ |
补充下 nginx 的简单配置:
把 |
这样不刷新页面是没有问题的。 我遇到的问题是
不知道我这个情况怎么配置nginx谢谢 |
@xjdata 资源文件的链接用绝对路径,比如 |
@sorrycc 谢谢。 |
roadhog server 开发环境如何使用browser history呢 |
同样求助,roadhog server 开发环境如何使用browser history呢 |
根据官方文档
import {browserHistory} from 'dva/router';
// 1. Initialize
const app = dva({
history: browserHistory,
});
这样是正常的 但是 访问路由下面的其他页面 变成了 not found。
当url 带有# 的字符 就是正常的 。请指教
The text was updated successfully, but these errors were encountered: