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

最新版本点击文档左侧 Menu,页面跳转后会重新刷新一遍 #289

Open
boyongjiong opened this issue Aug 2, 2024 · 1 comment

Comments

@boyongjiong
Copy link

2024-08-02 14 27 11

效果如上图

  1. 定位过程在 layouts/engry/Manual.tsx 中增加一个独立的 Menu。用写死的数据菜单数据(key 跟实际页面的一致),发现点击页面也会出现相同的效果
    代码:
    image

效果:
2024-08-02 14 38 57

  1. 依然不是很理解为什么 -。- 然后想理论上 ManualContent 只需要渲染 children ,是否有页面中其它操作导致 menu 的重新渲染,故注释无关代码,只保留
return (
    <div className="styles.markdown">{chidlren}</div>
)

这一行,发现没有问题了,页面跳转且渲染正确内容

  1. 最后就定位 slots/ManualContent/index.tsx 文件中会有什么操作导致它出现异常(注释所有代码,一段一段放开的方式),发现「获取阅读时间」的代码屏蔽后,问题消失了
    image

到最后也没理解为什么(也可能是别的什么原因),希望大佬能帮忙解答一下

@boyongjiong
Copy link
Author

那段代码注释后效果:
2024-08-02 14 48 17

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

No branches or pull requests

1 participant