0

我正在试验 React 和 react-data-table-component。我已经建立了一个这样的测试表:

<DataTable
    title={'TestTitle'}
    columns={[{ name: 'test 1', selector: 'test1' }, { name: 'test 2', selector: 'test2' }, { name: 'test 3', selector: 'test3' }, { name: 'test 4', selector: 'test4' }, { name: 'test 5', selector: 'test5' }]}
    striped
    responsive
    pagination paginationRowsPerPageOptions={[5, 10, 25, 50, 100]} />

我注意到在表格中标题 div 的右侧生成了一个 div。它只分配了一些奇怪的类。是否可以在此 div 中输入具有某些属性的数据到 DataTable?

在此处输入图像描述

我已经尝试了 subHeader 属性,但它将新文本放在标题下,使表格略高,这是不可取的。

<DataTable
    title={'TestTitle'}
    subHeader subHeaderComponent={'TestSubHeader'}
    columns={[{ name: 'test 1', selector: 'test1' }, { name: 'test 2', selector: 'test2' }, { name: 'test 3', selector: 'test3' }, { name: 'test 4', selector: 'test4' }, { name: 'test 5', selector: 'test5' }]}
    striped
    responsive
    pagination paginationRowsPerPageOptions={[5, 10, 25, 50, 100]} />

在此处输入图像描述

4

1 回答 1

1

好吧,显然我对自己的利益有点太不耐烦了。在我发布这个问题大约一分钟后,我意识到 actions 属性完全符合我的要求。我想我现在可能应该删除这个问题。或者这些信息对其他人有用吗?

于 2020-05-11T08:50:26.703 回答