3

我想将单词“of”的字符串更改为另一个单词,我尝试这样做,node_modules但没有成功。

这是我的代码:

<TableFooter>
  <TableRow>
    <TablePagination
      rowsPerPageOptions={[5, 10, 25, { label: "All", value: -1 }]}
      count={props.generalIndicatorDataItem.length}
      rowsPerPage={rowsPerPage}
      page={page}
      labelRowsPerPage="عدد السلع فى الصفحة"
      onChangePage={handleChangePage}
      onChangeRowsPerPage={handleChangeRowsPerPage}
      ActionsComponent={TablePaginationActions}
    />
  </TableRow>
</TableFooter>

这是我所拥有的截图:

在此处输入图像描述

4

1 回答 1

0

labelDisplayedRowsprops 是具有以下签名的回调:

({ from, to, count }) => string

这是您正确使用它的方式:

labelDisplayedRows={({ from, to, count }) =>
  `${from}-${to} OF ${count !== -1 ? count : `MORE THAN ${to}`}`}

现场演示

编辑 67297785/material-ui-how-can-i-change-tablepagination-caption-that-tells-how-many-rows-s

于 2021-04-28T10:13:08.533 回答