【问题标题】:noDataText in react-bootstrap-table-next does not workreact-bootstrap-table-next 中的 noDataText 不起作用
【发布时间】:2020-11-14 02:46:30
【问题描述】:

我需要在表格正文中显示“没有要显示的数据”。

我现在使用 react-bootstrap-table-next,它是 react-bootstrap-table 的高级版本

import BootstrapTable from 'react-bootstrap-table-next'
...
<BootstrapTable
    keyField="id"
    data={data}
    columns={columns}
    expandRow={expandRow}
    options={{ noDataText: 'There is no data to display' }}
/>

没有数据时不显示想要的文本。

任何帮助将不胜感激。

提前致谢。

【问题讨论】:

    标签: reactjs react-bootstrap-table


    【解决方案1】:

    试试这个

    const emptyDataMessage = () => { return 'No Data to Display';}
    

    &lt;BootstrapTable noDataIndication={emptyDataMessage} ../&gt;

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-11-16
      • 1970-01-01
      • 2015-12-06
      • 1970-01-01
      • 2021-06-28
      • 2013-01-05
      • 2019-11-06
      • 1970-01-01
      相关资源
      最近更新 更多