我需要知道是否可以使用 react-window 来显示项目列表,并在同一行显示带有每个操作的按钮。如果是,请给我一个关于如何做的提示。
import React from "react";
import { FixedSizeList as List } from "react-window";
const ListBebes = ({
bebes,
handleItemClick,
handleEditClick,
handleDeleteClick,
}) => {
const Row = ({ index, style }) => (
<div className={index % 2 ? "ListItemOdd" : "ListItemEven"} style={style}>
{bebes[index].nombres}
</div>
);
return (
<List
className="List"
height={5}
itemCount={bebes.length}
itemSize={35}
width={300}
>
Row
</List>
);
};
export default ListBebes;
<Col xs="4">
{this.state.is_fetching ? (
"Loading..."
) : (
<ListBebes
bebes={this.state.bebes}
handleItemClick={(id) => this.handleItemClick(id)}
handleEditClick={(id) => this.handleEditClick(id)}
handleDeleteClick={(id) => this.handleDeleteClick(id)}
></ListBebes>
)}
</Col>;