javascript - 如何在 React JS 中修改 Material UI prop-function 的默认值?
问题描述
我正在使用 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"
/>
我怎么能做到?先感谢您
解决方案
像这样的东西:
<TablePagination labelDisplayedRows={({ from, to, count }) => `Displaying pages ${from}-${to} of total ${count} pages`}/>
推荐阅读
- android - Android Studio 错误:原因:为 cmake /path/to/project/app/tools/CMakeLists.txt 执行外部原生构建
- c - %s 和 %s%*c 有什么区别
- c# - 将 ASP.Net Core Web App 项目发送给某人的最佳实践?
- javascript - 角度异步数据
- python - 是否可以使用 yolo 和 OpenCv 进行注释
- r - R找到连续的月份
- javascript - 尝试清除 Electron 中的缓存,但似乎不起作用
- r - BiocCheck() 用于 Bioconductor 包提交,不显示带有错误/警告的 LINES。/Notes
- python - 从 jupyter 笔记本调用外部 py 模块
- python - 预测Vgg16的输出,混淆