naive-ui icon indicating copy to clipboard operation
naive-ui copied to clipboard

是否可以支持两个树之间进行拖放

Open aohanhe opened this issue 2 years ago • 6 comments

This function solves the problem (这个功能解决的问题)

我现在有一个需求,要从左侧的树把节点拖放到右侧,但测试了一下现在n-tree是无法实现的,是否可以支持该功能。或者有其它方法来实现?

Expected API (期望的 API)

添加一个属性允许跨树进行拖放

aohanhe avatar Apr 20 '22 07:04 aohanhe

有这个想法,先看看难度吧。

07akioni avatar Apr 26 '22 18:04 07akioni

很需要这个功能,+1

songispm avatar Jun 11 '22 19:06 songispm

可稍微提一丢丢优先级

songispm avatar Jun 11 '22 19:06 songispm

拖动短期内不可能实现,现行的做法是使用 <NTransfer /> 然后在左边用 <NTree />,但是右侧目前不能自定义渲染。

equt avatar Aug 20 '22 03:08 equt

@07akioni 考虑允许右侧自定义?

目前先关闭,有自定义需求另开新 issue

equt avatar Aug 20 '22 03:08 equt

@equt antd 在比较老的版本直接支持,具体怎么搞的我不太记得了,后面重构失效了就一直没修好

主要是 Tree 的内部状态需要比较多的调整在能支持这件事

自定义这个事情是很难解决的,因为涉及到内部状态太多了

07akioni avatar Aug 20 '22 16:08 07akioni

This issue does not have any recent activity. If you are still experiencing similar problems, open a new error, including a minimal copy of the problem

jahnli avatar Mar 12 '24 13:03 jahnli