Can Ace Editor support multiple code editors in one page?

前端 未结 4 1106
一整个雨季
一整个雨季 2021-01-02 04:19

I\'m looking to implement a web app that features \"coding-competition\"-styled interface with 2 different code editors in a single screen. One will be read only and the oth

4条回答
  •  [愿得一人]
    2021-01-02 04:52

    What I did was instead of using the id editor I set it as a class so code Then I just iterated every editor.

    var editor;
    $('.editor').each(function( index ) {
      editor = ace.edit(this);
      editor.getSession().setMode('ace/mode/csharp');
    });
    

提交回复
热议问题