防止自动恢复页面位置 if (history.scrollRestoration) { history.scrollRestoration = 'manual'; } 查看当前页面滚动恢复行为 const scrollRestoration = history.scrollRestoration if (scrollRestoration === 'manual') { console.log('The location on the page is not restored, user will need to scroll manually.'); } 文档链接