let type=item.type,
url = location.protocol + '//' + location.host + '/web/'+type+'/show.html#/' + this.activity.activity_id+'/'+undefined+'/'+this.yiye.activity_id;
location.href = url;
上面type变化时正常跳转页面,只有hash改变时,不会刷新页面,于是我加上下面这句
location.reload();
现在hash值变了,上面会刷新页面,但当type改变时 页面却不会跳转了只是刷新了一遍,请问这是什么原因???
let pathname =location.pathname
location.href = url;
if(url.indexOf(pathname)!==-1){
location.reload();
}
最后我是这样解决的,判断路径是否变化来调用reload()