简体   繁体   English

摩纳哥编辑器创建实例而不提供编辑器容器

[英]Monaco editor creating an instance without providing the editor container

I want to inject the Monaco editor html code through javascript.我想通过javascript注入摩纳哥编辑器html代码。 However, the create function for the editor always asks for the container div.但是,编辑器的创建函数总是要求容器 div。

monaco.editor.create(document.getElementById('container-div'),{options})

Is there an option to create the instance without providing the wrapper and storing it in a variable so that I can use it or inject it via javascript later on?是否有一个选项可以在不提供包装器并将其存储在变量中的情况下创建实例,以便以后可以使用它或通过 javascript 注入它?

Not sure what the problem is.不确定是什么问题。 Just create a new HTML element as container and use that for injection.只需创建一个新的 HTML 元素作为容器并将其用于注入。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM