Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在博客插件下,点击进入某篇文章之后,使用浏览器的后退,将无法点击任何链接。 #115

Open
rainzee opened this issue Sep 18, 2023 · 1 comment
Assignees
Labels

Comments

@rainzee
Copy link
Contributor

rainzee commented Sep 18, 2023

当点击进入某篇文章后,使用浏览器的后退,回到博客主页,此时任何文章,都无法点击。

@Redlnn
Copy link

Redlnn commented Sep 18, 2023

原因是,按下后退按钮后回到博客主页时自动执行的 rerender() 内,有如下判断

if (lastProps && lastProps.layoutPath !== props.layoutPath) {
location.href = href;
return;
}

该判断中,lastProps.layoutPath !== props.layoutPath 成立,只改变了地址栏的 URL 就触发 returnloading 没有被置为 false,在下一次点击链接触发 rerender() 时,下面的判断使得函数无法运行到后续跳转的部分

if (loading === true) {
return;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants