hcg1023 / vue3-dnd

React Dnd implementation in Vue Composition-api.
https://www.vue3-dnd.com
MIT License
643 stars 52 forks source link

添加实时获取鼠标轨迹的范例代码 #30

Closed poerlang closed 2 years ago

poerlang commented 2 years ago

如果需要获取鼠标的 实时轨迹 (实时的Offset),应该关注一下 DropTargetMonitor 而不是 DragSourceMonitor, 比如,你可以在 useDrop 的回调 hover: (item, monitor) => {...} 的参数中获取 DropTargetMonitor:

<--范例代码-->

changeset-bot[bot] commented 2 years ago

⚠️ No Changeset found

Latest commit: 2f8233182cd36eac1af23384cbceb40e9cafca8e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
vue3-dnd ✅ Ready (Inspect) Visit Preview Aug 16, 2022 at 4:10AM (UTC)
hcg1023 commented 2 years ago

@poerlang 关于这个注意的内容以及示例代码,放到常见问题模块会好一些吧,并且在hover中赋值也不是必要的,更多的是他需要知道在hover中能做这个事情,如果在hover外部需要offset等信息,应该是通过collect暴露属性

poerlang commented 2 years ago

了解了解