We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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回调函数中只返回了dropNode和dropPosition,当禁止将子节点拖到父节点之外的情况下不足以满足判断,只有在drop时才能拿到dragNode和dropNode进行比较判断
The text was updated successfully, but these errors were encountered:
@lambert959 hi,请补充更详细的功能说明(组件,事件,参数,场景等)。
Sorry, something went wrong.
组件: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组件
No branches or pull requests
目前,allow-drop回调函数中只返回了dropNode和dropPosition,当禁止将子节点拖到父节点之外的情况下不足以满足判断,只有在drop时才能拿到dragNode和dropNode进行比较判断
The text was updated successfully, but these errors were encountered: