Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow-drop 增加 dragNode 数据返回 #1457

Open
lambert959 opened this issue Jul 27, 2022 · 2 comments
Open

allow-drop 增加 dragNode 数据返回 #1457

lambert959 opened this issue Jul 27, 2022 · 2 comments
Labels
💪🏻 Enhancement feature enhancement 💤 Inactive Inactive issues

Comments

@lambert959
Copy link

目前,allow-drop回调函数中只返回了dropNode和dropPosition,当禁止将子节点拖到父节点之外的情况下不足以满足判断,只有在drop时才能拿到dragNode和dropNode进行比较判断

@hehehai
Copy link
Contributor

hehehai commented Sep 12, 2022

@lambert959 hi,请补充更详细的功能说明(组件,事件,参数,场景等)。

@hehehai hehehai added the 📄 Need more info Need more info label Sep 12, 2022
@Kuohao-wu
Copy link

组件:tree组件
相关props: allow-drop: (options: { dropNode: TreeNodeData; dropPosition: -1 | 0 | 1;}) => boolean
期望:allow-drop钩子函数参数回传draggingNode节点。
场景:当希望子节点拖拽仅发生在直系父节点内,如1-1节点下存在1-1-1、1-1-2、1-1-3,这三个节点只能在1-1节点下拖拽,禁止拖拽到1-1节点之外。需要判断dragNode和dropNode是否拥有相同父节点才能实现,dropNode和dropPosition并不足以判断。
备注:onDrop回调可以实现这种限制,但是这种方式为发生了拖拽之后判断,如果事前需要禁止拖拽行为,需要使用allow-drop钩子。

参考:可element-ui 的tree组件

@oljc oljc added 💪🏻 Enhancement feature enhancement and removed 📄 Need more info Need more info labels Sep 11, 2024
@github-actions github-actions bot added the 💤 Inactive Inactive issues label Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪🏻 Enhancement feature enhancement 💤 Inactive Inactive issues
Projects
None yet
Development

No branches or pull requests

4 participants