你如何去铁路由器的前一个路线? [英] How do you go to the previous route in iron-router?

查看:110
本文介绍了你如何去铁路由器的前一个路线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 'click #back': -  

>
history.back()

这适用于Chrome桌面,Chrome devtools移动设备视图,并在Safari上使用物理设备本身(iOS 8.1.2),但不使用设备上的Chrome。行为是:
$ b


  • 加载/

  • 点击链接到/ foo

  • URL更改为/ foo和foo模板呈现

  • 单击#back

  • URL更改为/ FOO。页面主体不会更改。 (正确的行为是URL永久地更改为/,并且/ templates被呈现,而不会加载页面。)

  • 点击#back second time

  • /从服务器重新加载



这是一个移动Chrome问题,还是应该使用一些铁路路由器API,如 Router.back()

解决方案

history.back () iron-router 支持的方法,它只是显示iOS Chrome存在问题。


I'm using an event handler to go to the previous URL/route:

'click #back': ->
  history.back()

This works in Chrome desktop, Chrome devtools mobile device view, and in Safari on a physical device itself (iOS 8.1.2), but not in Chrome on the device. Behavior is:

  • Load /
  • Click link to /foo
  • URL changes to /foo, and foo template renders
  • Click #back
  • URL changes to / briefly, then changes back to /foo. The page body does not change. (Correct behavior is the URL permanently changes to /, and the / templates are rendered, without a page load.)
  • Click #back second time
  • / is reloaded from server

Is this a mobile Chrome problem, or should I be using some iron-router API like Router.back()?

解决方案

history.back() is the method supported by iron-router, it just appears there's a problem with iOS Chrome.

这篇关于你如何去铁路由器的前一个路线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆