【发布时间】:2018-05-28 10:10:50
【问题描述】:
我正在使用 React JS,我从 Material UI 导入了一个名为 (https://material-ui.com/api/table-pagination/) 的组件,我想修改 labelDisplayedRows 的默认值,现在是这样的:
({ from, to, count }) => ${from}-${to} of ${count}
我想编辑输出的“of”,但它是一个函数,所以我不知道该怎么做。 如果它是像 labelRowsPerPage 这样的简单节点,我会通过编写
来修改它<TablePagination
labelRowsPerPage="text text text"
/>
我该怎么做? 提前谢谢你
【问题讨论】:
-
给它一个返回你需要的字符串的函数?你的问题到底出在哪里?
-
解决方案是这样的:
Displaying pages ${from}-${to} of total ${count} pages}/>
标签: javascript reactjs material-ui