ant-design-vue icon indicating copy to clipboard operation
ant-design-vue copied to clipboard

Components.Tree:Document sample judgment error @drop=ondrop

Open shuimupj opened this issue 3 years ago • 1 comments
trafficstars

  • [ ] I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.3.0-beta.2

Environment

chrome

Reproduction link

https://www.antdv.com/components/tree-cn#components-tree-demo-draggable

Steps to reproduce

文档的“Tree 树形控件”参考案例中拖动示例代码

const onDrop = info => {
...
if (!info.dropToGap) {
...
} else if (
(info.node.children || []).length > 0 && // Has children
info.node.expanded && // Is expanded
dropPosition === 1 // On the bottom gap
) {
...
} else {
...
}
...
}

其中info.node.children判断是否有误?

@drop的回调参数{event, node, dragNode, dragNodesKeys}中node下面没有children,只有一个dataRef且会包含children

What is expected?

能否解释一下else if的逻辑作用

What is actually happening?

@drop=onDrop 的回调参数info, info.node下并无children

shuimupj avatar Jul 13 '22 06:07 shuimupj

image

tangjinzhou avatar Jul 24 '22 05:07 tangjinzhou

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Sep 23 '22 04:09 github-actions[bot]

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Oct 01 '23 00:10 github-actions[bot]