提交 e03a4e16 编写于 作者: A afc163

site: fix hash link

close #12683
上级 f24917bb
......@@ -62,7 +62,7 @@ export default class MainContent extends React.Component {
if (!prevProps || prevProps.location.pathname !== location.pathname) {
this.bindScroller();
}
if (!prevProps || (!window.location.hash && prevProps && prevProps.location.pathname !== location.pathname)) {
if (!window.location.hash && prevProps && prevProps.location.pathname !== location.pathname) {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
return;
......@@ -74,7 +74,7 @@ export default class MainContent extends React.Component {
if (window.location.hash) {
document.querySelector(window.location.hash).scrollIntoView();
}
}, 10);
}, 50);
}
componentWillUnmount() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册