Tencent / tmagic-editor

Other
4.22k stars 714 forks source link

dragTo方法的疑问 #552

Closed sunlho closed 1 year ago

sunlho commented 1 year ago

CleanShot 2023-11-13 at 15 54 10@2x 我想实现当元素拖入到流式布局的容器内时,将style修改掉,当时是修改成功了,但是当触发update时就变回了原先的样式,感觉是当时没有去掉用update更新数据,可以实现一下吗 @jia000

jia000 commented 1 year ago

没看懂你的问题

但是流式布局使用的是sort方法来更新的,不是用dragTo.

dragTo是用在组件树拖动节点

sunlho commented 1 year ago

其实就是现在将一个元素拖入到流式布局内,被拖入的元素还是absolute的,我需要重新去改变容器的布局从而实现将元素改为relative.我想实现就是在拖动进去后直接吧元素改成relative https://github.com/Tencent/tmagic-editor/assets/74301510/84233dc7-1e26-464e-a35c-3f3b4b9acbdd

sunlho commented 1 year ago

想实现这种效果,我现在实现的方法就是去改掉dragTo方法,但他现在有弊端 https://github.com/Tencent/tmagic-editor/assets/74301510/ae229911-8eb4-4de0-a41f-44ec70135cfe @jia000