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

急!急!急!关于Control.go的问题 #108

Open
nuonuonuonuoyan opened this issue Mar 29, 2019 · 5 comments
Open

急!急!急!关于Control.go的问题 #108

nuonuonuonuoyan opened this issue Mar 29, 2019 · 5 comments

Comments

@nuonuonuonuoyan
Copy link

第一个问题:
在前进时,可以使用Control.go(path),那返回的时候呢? 比如我从 '/page01'跳到'/page02'再到03,04,最后到05的时候需要返回到page01,该怎么做? 如果在05页面使用Control.go('/page01),会不会继续入栈?
第二个问题:
使用了路由缓存之后,比如我01页面需要缓存,然后我到03页面做了一些操作之后回到01页面,需要改变01页面的一些状态,比如提交按钮文字变为签名,得到03页面的数据调用新的接口,这些要怎么做?

@lanistor
Copy link
Owner

  1. 第一个问题:
    Control.go(-1)
  2. 第二个问题
    Keeper暂时未开放路由变化API,可以使用父组件State、Redux这样的状态管理方式来实现,然后监听state、props

@nuonuonuonuoyan
Copy link
Author

第一个我说的是从05页面直接返回01页面,如果Control.go(-1)的话,只是回到了04页面

@lanistor
Copy link
Owner

Control.go(-4)

@nuonuonuonuoyan
Copy link
Author

第二个问题使用高阶组件能解决吗? 专门监听state,props

@lanistor
Copy link
Owner

lanistor commented Apr 1, 2019

@nuonuonuonuoyan 使用state也可以实现的

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