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

拖拽添加图元到画布可以直接传 pen 对象吗,转成 json 字符串会导致 pen中定义的方法丢失 #233

Closed
Justicx26 opened this issue Mar 1, 2024 · 2 comments

Comments

@Justicx26
Copy link

No description provided.

@SignDawn
Copy link
Contributor

基于 ondrop 来实现,event.dataTransfer.getData 只能拿到字符串。
解决方法:
考虑使用 addCaches 来实现,不基于 ondragstart .

其它解决方案应该也有,麻烦提供一个 codesandbox 的 demo

@ananzhusen
Copy link
Contributor

也可以监听add消息,给图元添加方法 https://doc.le5le.com/document/119626293

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

3 participants