更新时间:2023-12-03 08:33:04
尽管是实验性的,但您可以尝试调整到" manual"
.
Although it is experimental, you can try adjusting the History scrollRestoration from "auto"
to "manual"
.
这里有一些可以进行填充来帮助跨浏览器兼容也是.
There are a few polyfills out there to help with cross-browser compatability too.
if ('scrollRestoration' in history) {
// Back off, browser, I got this...
history.scrollRestoration = 'manual';
}