0

我正在尝试构建一个简单的可拖动对象实现,react-beautiful-dnd但显然我的可拖动对象不会移动。

这是我在 CodeSandbox 中的示例代码:

https://codesandbox.io/s/using-react-beautiful-dnd-with-hooks-zqpi9?fontsize=14&hidenavigation=1&theme=dark

4

1 回答 1

1

只需style从子级中删除属性draggable(在您的情况下它是Block组件)。DnD 使用它自己的style属性并且你覆盖它。你必须使用它来className代替它。

你的例子没有style
https://codesandbox.io/s/using-react-beautiful-dnd-with-hooks-1m4zm

于 2020-04-02T16:18:02.220 回答