我正在使用material-table. 在TablePagination不工作。它在控制台中引发错误。
我尝试按照文档安装软件包。
https://material-table.com/#/docs/install
npm install material-table --save
npm install @material-ui/core --save
Run Code Online (Sandbox Code Playgroud)
我得到这个错误:
Material-UI:
caption提供给 classes 道具的键未在 ForwardRef(TablePagination) 中实现。您只能覆盖以下其中一项:root,toolbar,spacer,selectLabel,selectRoot,select,selectIcon,input,menuItem,displayedRows,actions。警告:失败的道具类型:道具
onPageChange在 中标记为必需ForwardRef(TablePagination),但其值为undefined。警告:未知的事件处理程序属性
onChangePage。它将被忽略。警告:未知的事件处理程序属性
onChangeRowsPerPage。它将被忽略。
版本:
"@material-ui/core": "^5.0.0-alpha.24",
"material-table": "^1.69.2",
Run Code Online (Sandbox Code Playgroud)
如果我尝试分页,它会在控制台中引发错误。
未捕获的类型错误:_this.props.onChangePage 不是函数
示例代码:
<MaterialTable
icons={tableIcons}
columns={columns}
data={editable}
title="Orders"
localization={{
toolbar: {
searchPlaceholder: 'Filter',
searchTooltip: 'filters the given text'
},
header: {
actions: 'Actions'
}
}}
actions={[
{
icon: 'save',
tooltip: 'Save User',
onClick: (event, rowData) => …Run Code Online (Sandbox Code Playgroud)