Kal*_*n A 3 datatable filtering reactjs
我需要将下面的代码转换为没有钩子的普通类组件,任何人都可以帮助我,这是我指的链接 https://jbetancur.github.io/react-data-table-component/?path =/story/filtering--example-1 我需要在不使用钩子的情况下进行过滤,因为我只使用类组件。以下是我正在使用的版本:- "react-data-table-component": "^6.9.3", "react": "^16.12.0",
您可以过滤组件本身
<DataTable
pagination="true"
columns={columns}
data={leaderBoardList.filter((item) => {
if (searchTerm === "") {
return item;
} else if (
item.name.toLowerCase().includes(searchTerm.toLowerCase())
) {
return item;
}
})}
/>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
21845 次 |
| 最近记录: |