您也可以提供内联样式和条件样式。如下面的代码所示它的内联样式。
<Droppable
droppableId={`${laneItem.Value}`}
type="TASK"
key={`droppable-${laneItem.Value}`}
>
{(provided) => (
<div
id={laneItem.Value}
ref={provided.innerRef}
{...provided.droppableProps}
key={`droppable-div-${laneItem.Value} - ${index + 1}`}
style={{ height: '200px' }}
>
这里是条件样式,
<Droppable
droppableId={`${laneItem.Value}`}
type="TASK"
key={`droppable-${laneItem.Value}`}
>
{(provided) => (
<div
id={laneItem.Value}
ref={provided.innerRef}
{...provided.droppableProps}
key={`droppable-div-${laneItem.Value} - ${index + 1}`}
styles={true ? bigHeight : smallHeight}
>
其中 big-Height 和 small-Height 是 const。
const big-Height: any = {
root: {
height: "200px"
}
}