如何使用包含子表的ReactTable制作表

问题描述 投票:0回答:1

我有React-Table组件,我需要在其中插入包含子数据(子表)的数据。

我需要在表中添加一个扩展器,当我们单击该表时,父行将展开并显示子项

[{
  instrument: 'bitcoin',
  tradeAmount: '4000',
  children: [
      {
         instrument: 'bitcoin',
         tradeAmount: '1000'
      },
      {
         instrument: 'bitcoin',
         tradeAmount: '3000'
      }
    ]
 },
 {
  instrument: 'ethereum',
  tradeAmount: '6500'
 }
]

我试图将<ReactTable />组件的'pivotBy'属性添加到该属性,并且还使用了SubComponent属性,但是它们对我没有帮助。有人知道该怎么做吗?

reactjs react-table
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.