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

怎么实现不同视图的拖拽 #81

Open
zt6991 opened this issue Jun 5, 2023 · 3 comments
Open

怎么实现不同视图的拖拽 #81

zt6991 opened this issue Jun 5, 2023 · 3 comments

Comments

@zt6991
Copy link

zt6991 commented Jun 5, 2023

想实现从自定义视图拖拽到编辑器的拖拽效果,请问有什么好的实现方式。
我自己用antd的tree组件,拖拽到其他视图时没有触发到拖拽的回调函数。

@MMhunter
Copy link
Contributor

MMhunter commented Jun 5, 2023

目前编辑器对拖拽事件的响应只有打开 dragTransfer 中的 uri 数据
image
如果要实现除了“打开 uri” 之外的功能,比如可视化搭建等等,可能需要获取当前编辑器实例然后在 monaco 的相关事件上绑定一下

@zt6991
Copy link
Author

zt6991 commented Jun 12, 2023

谢谢回复
1.编辑器实例要怎么获取?
2. monaco 事件绑定要怎么做呢?
有类似的代码例子吗?

@zt6991
Copy link
Author

zt6991 commented Jun 15, 2023

我试过修改上图代码,没有生效(node_modules里的代码)。还找过MonacoService和WorkbenchEditorService的api,没有看到拖拽相关的事件
image

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