|
请问,我参考use-antd项目实现自定义编辑器,如何在tsx里读取到打开的文件路径以及内容? |
Answered by
hnhhzy
Mar 1, 2023
Replies: 3 comments 8 replies
|
https://github.com/opensumi/opensumi-module-samples/tree/main/modules/use-antd 这个项目的demo,在txs里如何读取到打开的这个文件地址以及内容? |
8 replies
|
const test = useInjectable(WorkbenchEditorService); |
0 replies
Answer selected by
hnhhzy
|
自定义编辑器component时,可以看下props里面有个一个resource变量,在这里你可以拿到想要的内容。 后续我会在samples补充一下这块的用法。 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
const test = useInjectable(WorkbenchEditorService);
const data = test.currentResource?.uri;
好像可以了……