Skip to content

在 router 中配置了 fallback: false 后,在 IE 9 下不停的刷新 #221

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

Closed
cheneywan opened this issue Jul 4, 2017 · 5 comments · Fixed by #254
Closed

在 router 中配置了 fallback: false 后,在 IE 9 下不停的刷新 #221

cheneywan opened this issue Jul 4, 2017 · 5 comments · Fixed by #254

Comments

@cheneywan
Copy link

测试环境中只把 vue-router 版本升级到 2.7.0,其他代码都没改

本希望通过 fallback 选项把自动回滚到 hash 模式给禁用掉,从而实现在 IE 9 中点击链接能重新刷新页面。不知道是不是配置有问题?

image

@cheneywan
Copy link
Author

@JounQin

@JounQin
Copy link
Contributor

JounQin commented Jul 5, 2017

fallback: false 去掉也是一样的,#218 ,具体原因没深入看

我自己的 vue-ssr 在 IE 9 上运行是没有问题的。

https://vue-ssr.1stg.me/

@cheneywan
Copy link
Author

@JounQin 多谢回复,您的 Demo 确实没问题

我看了下,大概是在执行 store.replaceState(window.__INITIAL_STATE__) 这句后就 reload 了,具体原因没看出来 ଲ

untitled2

@wenyejie
Copy link

wenyejie commented Aug 5, 2017

我也遇到过类似的问题, 不过我是直接在safari(也好像是QQ浏览器, 有点记不得了),
不过我当时, 是使用store的时候, 好像出现了某种类似于死循环的bug(好像是, actioin与getters之间出了点问题), 具体问题没查出来,
毕竟一直在reload, 后来我重构了一遍该方法就好了!

@xsbchen
Copy link

xsbchen commented Aug 11, 2017

暴力解决:

if (!(window.history && 'pushState' in window.history)) {
  // 阻止调用store.replaceState,导致死循环的关键
  window.__INITIAL_STATE__ = null;

  // 直接跳转
  window.history.pushState = function(state, title, url) {
    location.href = url;
  };

  // 直接跳转
  window.history.replaceState = function(state, title, url) {
    location.href = url;
  };
}

yyx990803 pushed a commit that referenced this issue Sep 21, 2017
* close issues: close #202, close #231
close prs: close #209, close #216, close #244

* fallback false, remove unused `glob`

* upgrade vuex-router-sync, fix #221, fix #218, fix #208, fix #207

* lock firebase at version 4.1.3 (firebase/firebase-js-sdk#157 (comment))
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

Successfully merging a pull request may close this issue.

4 participants