Alfred-Skyblue / vue-draggable-plus

Universal Drag-and-Drop Component Supporting both Vue 3 and Vue 2
https://vue-draggable-plus.pages.dev/en/
MIT License
3.05k stars 128 forks source link

关于自定义clone的问题 #54

Closed guccihuiyuan closed 9 months ago

guccihuiyuan commented 11 months ago

类似低代码场景,我从左侧列表拖拽组件到右侧画布中,使用自定义克隆,当添加到右侧画布时,会自动将自定义克隆中返回的对象加入到右侧画布中model-value绑定的list对象中,但是我不想这么做,因为在添加数据前,我还需要对数据做一些处理,在添加到list数据中,这个如何实现呢?

添加完成后会触发onAdd方法,其中可以拿到添加的索引,目前是可以手动根据添加的索引将元素删除,在手动处理,放在list列表中,还有其他好的方法吗?

Alfred-Skyblue commented 11 months ago

https://alfred-skyblue.github.io/vue-draggable-plus/demo/custom-clone/

在clone函数中操作返回数据