pro-components icon indicating copy to clipboard operation
pro-components copied to clipboard

🧐[问题] DragSortTable组件是否支持tree格式的数据跨级拖拽?

Open gaoyouAwait opened this issue 3 months ago • 1 comments

提问前先看看:

https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md

🧐 问题描述

tree格式的table,支不支持跨级拖拽

💻 示例代码

类似antd的tree组件,跨级拖拽

🚑 其他信息

Image

gaoyouAwait avatar Sep 10 '25 02:09 gaoyouAwait

Hi @gaoyouAwait! I'm Dosu and I’m helping the pro-components team.

DragSortTable 目前不支持 tree 格式数据的跨级拖拽。它只支持对扁平数据进行行排序,所有官方文档、示例和源码都没有对树形结构或跨父节点拖拽的支持,相关 issue 和维护者回复也明确说明了这一点,尝试用 DragSortTable 实现树形跨级拖拽会遇到不可控或不支持的问题[issue 7939]官方源码

如果你需要类似 antd Tree 组件的跨级拖拽,建议直接使用 antd 的 Tree 组件(支持 draggableonDrop 事件)[antd Tree 文档],或者自行实现业务定制的拖拽逻辑。社区有用户分享过自定义实现,但都不是通用方案,官方暂无计划支持 tree/cross-level 拖拽[相关讨论]。

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

dosubot[bot] avatar Sep 10 '25 02:09 dosubot[bot]