React-virtualized:如何仅使用 minWidth

React-virtualized: how to use minWidth only

我有 <Column /> 宽度属性。如何使最后一列的宽度等于所有可用宽度(我的意思是块中所有其他空闲 space)?尝试设置 minWidth,但需要宽度...

如果我设置较大的宽度,我在小屏幕上的其他列会减少​​。

查看 Column docs。相关的是:

flexGrow    Number  Flex grow style; defaults to 0
flexShrink  Number  Flex shrink style; defaults to 1
maxWidth    Number  Maximum width of column; this property will only be used if :flexGrow is greater than 0
minWidth    Number  Minimum width of column
width       Number  Flex basis (width) for this column; This value can grow or shrink based on flexGrow and flexShrink properties

在这种情况下,我相信您只需将 flexGrow={1} 添加到最后一列即可。 Table 使用弹性框布局。

FWIW 这也是 react-virtualized Table demo works. You can see its source code here