【发布时间】:2021-04-05 04:15:44
【问题描述】:
我想渲染一个没有任何垂直滚动条的材质 UI 数据网格。这是网格的代码:
return <div style={{height: 400, width: '100%', } }>
<DataGrid className={classes.root} rows={closedPositions} columns={columns} rowHeight={20}
headerHeight={25} disableSelectionOnClick pageSize={20} autoPageSize={true} scrollbarSize={1}
components={{
pagination: CustomPagination,
}}
/>
autopageSize 的文档是:
If true, the pageSize is calculated according to the container size and the max number of rows to avoid rendering a vertical scroll bar.
因此我很困惑为什么我有一个滚动条。即使我将 div 设置为高度 10,000,表格中没有行,我仍然会得到一个滚动条。
此外,scrollbarSize 为 15 和 1 之间没有区别(对于我想要的水平滚动条)。
有人知道怎么回事吗?
【问题讨论】:
标签: reactjs material-ui react-material