【问题标题】:React Virtualized - Changing the height of a List Row post renderReact Virtualized - 更改列表行后期渲染的高度
【发布时间】:2017-04-20 01:04:25
【问题描述】:

我在内部使用List,并使用rowHeight 的函数动态高度使用AutoSizer。我的用例中的行需要用省略号呈现并在单击它时展开。

我想知道如何在行已经呈现后动态设置rowHeight

【问题讨论】:

    标签: reactjs react-virtualized


    【解决方案1】:

    Here 是做类似事情的一个例子(here 是源代码)。关键部分是here

    // When height changes externally, let List know to reset its cached size
    List.recomputeRowHeights()
    List.forceUpdate()
    

    【讨论】:

    • 来自文档:recomputeRowHeights() - ...此方法还将强制渲染周期(通过 forceUpdate)...
    猜你喜欢
    • 2018-04-28
    • 1970-01-01
    • 2017-04-01
    • 2019-03-17
    • 2017-11-29
    • 2017-04-20
    • 2021-05-17
    • 2017-10-06
    • 1970-01-01
    相关资源
    最近更新 更多