Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dragTo方法的疑问 #552

Closed
sunlho opened this issue Nov 13, 2023 · 3 comments
Closed

dragTo方法的疑问 #552

sunlho opened this issue Nov 13, 2023 · 3 comments

Comments

@sunlho
Copy link

sunlho commented Nov 13, 2023

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

@jia000
Copy link
Collaborator

jia000 commented Nov 13, 2023

没看懂你的问题

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

dragTo是用在组件树拖动节点

@sunlho
Copy link
Author

sunlho commented Nov 13, 2023

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

@sunlho
Copy link
Author

sunlho commented Nov 13, 2023

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

@jia000 jia000 closed this as completed in ce0c941 Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants