We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
如何实现代码fold功能?
The text was updated successfully, but these errors were encountered:
组件底下的数据模型就是那个hunks数组,实际上代码折叠之类的都是基于这个数组上的操作。比如把数组中隐藏一些东西,代码自然不显示出来了,然后再用Decoration这个组件加上“展开”之类的功能就行
hunks
Decoration
具体的,你可以考虑看下原码中的site这个目录,它是一个功能比较全面的示例,里面的Unfold这个组件就是用来展开代码的,它会收一个叫onExpand的函数,这个函数定义在site/components/DiffView/index.tsx文件里的expandRange函数,用了react-diff-view直接提供的能力,应该比较容易看懂
site
Unfold
onExpand
site/components/DiffView/index.tsx
expandRange
react-diff-view
Sorry, something went wrong.
No branches or pull requests
如何实现代码fold功能?
The text was updated successfully, but these errors were encountered: