replaceState pushState,location.hash 比较
window.history.replaceStete('index','','#/index')
// 替换当前URL, 不会 在history的历史记录中添加记录,不会触发hashchange监听
window.history.pushState('index','','#/index')
// 替换当前URL, 会 在history的历史记录中添加记录,不会触发hashchange监听
location.hasn='#/index'
//替换当前URL, 会 在history的.
原创
2021-11-12 15:26:52 ·
277 阅读 ·
0 评论