Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要打开/关闭其他行详细信息。
有没有人实施或有关于如何为每一行实施展开/折叠功能的想法?
这种事情有一个模板(demo,source)重要的是,您需要告诉您的List/ Grid/无论何时打开/关闭已更改(也就是大小可能已更改),例如:
List
Grid
this._listRef.recomputeRowHeights(indexOfChangedRow) // Clear cached size this._listRef.forceUpdateGrid() // Rerender list with new size
物有所值 ... :-)
CodeSandbox 示例
我一直在寻找相同的功能,但在搜索时没有找到一些有用的结果,也许这个沙箱可以帮助其他人在他们的应用程序中寻找类似的功能:
这个例子是Table从react-virtualized旁边使用的react hooks。
Table
react-virtualized
react hooks
例子