And*_*oya 2 material-ui material-ui-next
如何删除选择的“每页行数”?我不想在我的项目中使用它...
小智 13
您将在文档中看到正确答案。请参阅属性“ rowsPerPageOptions”。文档说明:
自定义每页选择字段的行选项。如果少于两个选项可用,则不会显示选择字段。
因此,您必须指定rowsPerPageOptions = {[]}就是这样。Doc。页面:https://material-ui.com/api/table-pagination/
抱歉,我的语言。
小智 6
不幸的是,我还不能发表评论。
\n但对于 MUI 5,我在尝试空数组时遇到错误。
\n原因可能是我的 pageSize 设置为 5,因此以下内容对我来说效果很好:
\npageSize={5}\nrowsPerPageOptions={[5]}\n
Run Code Online (Sandbox Code Playgroud)\n这是对 FooBar 评论的回答:
\n\n\n这是一个很好的解决方案,但它会在 Material UI 5 中显示错误:Material-UI: The page size 100 is not preset in the rowsPerPageOptions 添加它以显示分页选择。\xe2\x80\x93 FooBar 10 月 26 日 14:26
\n
就在属性分配labelRowsPerPage
中TablePagination
标记为空字符串。
<TablePagination
labelRowsPerPage=''
{...otherProps}
/>
Run Code Online (Sandbox Code Playgroud)
小智 5
只需将选项属性(分页设置为 false)添加到材质表的 JSX 调用中
<MaterialTable
//your other props
options={{
paging: false
}}
/>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
3553 次 |
最近记录: |