1

我正在使用 react-beautiful-dnd 将团队成员拖放到不同的团队列表中。我有多个团队列表,以及一个添加新团队列表的按钮。添加 4 个团队后,我希望第 5 个团队列表位于第二行。

在此处输入图像描述

这可能吗?如果是这样,怎么做?目前,它水平延伸。从不同行重新排序列表不是优先事项,但是,我希望能够将团队成员拖放到不同行的团队列表中。

这是代码框: https ://codesandbox.io/s/teamlist-priwp?fontsize=14&hidenavigation=1&theme=dark

4

1 回答 1

1

我在 css 中做了 2 处更改,您可以使用flex-wrap

//App.js
const Container = styled.div`
  display: flex;
  flex-wrap: wrap; // <---- added
`;


//Team.js
// removed other flex properties from below
const Container = styled.div`
  margin: 8px;
  border: 1px solid lightgrey;
  border-radius: 2px;
  width: 220px;
  background-color: white;
`;

工作演示

编辑#SO-flex-wrap-issue

于 2020-06-12T06:51:24.807 回答