简体   繁体   中英

Monaco editor creating an instance without providing the editor container

I want to inject the Monaco editor html code through javascript. However, the create function for the editor always asks for the container 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?

Not sure what the problem is. Just create a new HTML element as container and use that for injection.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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