如何在react-table上使用react-perfect-scrollbar来覆盖默认滚动条?

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

我正在尝试在react-table上使用react-perfect-scrollbar,但它不起作用,它在自定义表上。

<PerfectScrollbar>
        <Table className='table'>
          <thead className='table-head'><tr>{head}</tr></thead>
          <tbody className='DashboardCard-table-body'>{body}</tbody>
        </Table>
      </PerfectScrollbar>

我试过这个:

<PerfectScrollbar>
    <ReactTable data={data} columns={columns} />    
</PerfectScrollbar>

它应该显示新的滚动条但它没有..没有在任何地方找到信息。

reactjs react-table perfect-scrollbar
1个回答
0
投票

您是否尝试在PerfectScrollbar JSX元素上设置高度?我有一个类似的问题,我用这个解决了:

<PerfectScrollbar style={{ height: "100vh" }}>
    ...Your content...
</PerfectScrollbar>

您可能需要为高度使用不同的值,但显然滚动条需要高度值。

© www.soinside.com 2019 - 2024. All rights reserved.