Skip to content
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

子route时,用f5刷新时,发现父route的数据没有了。 #76

Closed
bjwulin opened this issue Sep 12, 2016 · 2 comments
Closed

子route时,用f5刷新时,发现父route的数据没有了。 #76

bjwulin opened this issue Sep 12, 2016 · 2 comments

Comments

@bjwulin
Copy link

bjwulin commented Sep 12, 2016

1、我的系统是左边是菜单,右边是操作区。官方例子用的是layout,我觉得麻烦,用了:

<Route path='main' component={MainPage}>
      <Route path='person' component={PersonPage}/>
</Route>

MainPage负责获得菜单数据,PersonPage负责获取人员列表,打开PersonPage后,按f5刷新时,MainPage的菜单数据为空了...

另外,顺带问下2个问题:
2、我现在开发也是用proxy,我想问问,如果正式部署的时候,我也希望前端和后端分开部署,这个时候怎么办?用fetch-jsonp?

3、dva mobile的例子,比如说,我最开始打开的是个登录页面:
app.router(() => <LoginView />);

我想登录成功后,跳转到,这个MainView是个Tabbar的容器,这个时候我应该怎么跳转?

@sorrycc
Copy link
Member

sorrycc commented Sep 12, 2016

  1. 没明白问题,为啥 MainPage 数据会空?
  2. 开发和生产环境用的库最好保持一致,跨域也可以配 Access-Control-Allow-Origin 头
  3. mobile 的路由只能指定一个 View,比如 AppView,然后在这里面根据登录状态切换 Component 加载情况

@sorrycc
Copy link
Member

sorrycc commented Sep 13, 2016

有问题再 reopen 。

@sorrycc sorrycc closed this as completed Sep 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants