[英]Browser window doesn't reload with window.location? Router issue?
[英]window.location doesn't reload with params
我在这里用params替换window.location:
window.location.replace('/results/#'+ params);
但这不会用新的参数重新加载页面,Im还试图在以下时间重新加载页面:
window.location.pathname === '/results/' && window.location.reload();
但这会重新加载旧的页面
#
哈希表示当前页面的一部分,因此不会导致页面重新加载。 您可以在onhashchange
听onhashchange
并做一些事情。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.