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

支持 locator.replace(url) #98

Open
Justineo opened this issue Mar 2, 2014 · 5 comments
Open

支持 locator.replace(url) #98

Justineo opened this issue Mar 2, 2014 · 5 comments
Milestone

Comments

@Justineo
Copy link
Member

Justineo commented Mar 2, 2014

希望可以让某个 action 不计入浏览历史。

@otakustay
Copy link
Member

要求不计入历史必然地址栏不能变化,是要这个效果吗?

在 2014年3月2日,17:48,GU Yiling notifications@github.com 写道:

希望可以让某个 action 不计入浏览历史。


Reply to this email directly or view it on GitHub.

@Justineo
Copy link
Member Author

Justineo commented Mar 2, 2014

对的,就是类似 location.replace 的效果。

@leeight
Copy link
Member

leeight commented Mar 2, 2014

@otakustay
Copy link
Member

locator.redirect被映射到Action.prototype上,带有对主Action和子Action的分别处理,除此之外的目的是让Action的可测性更高,不需要依赖ER框架就能测试

同理,我认为replace也需要放在Action.prototype上,那么:

  1. 对于子Action,这个方法的效果是什么?我建议和redirect相同,仅作用于子Action,除非传递{ global: true }作为参数
  2. 全部统一到redirect如何?this.redirect(url, { replace: true, global: true })

@otakustay
Copy link
Member

现阶段可以直接用controller.renderAction(url)来完成你要的功能,后续我还是需要仔细设计一下replace的实现,所以建议你先委屈着用controller

@otakustay otakustay added this to the 3.2.0 milestone Apr 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants