Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道你用
editor.setValue("");
设置一个值,但如何在 CodeMirror 中追加?
IE:
editor.appendText();?
使用replaceRange. 例如editor.replaceRange(myString, CodeMirror.Pos(editor.lastLine())). 重新设置整个编辑器是不必要的昂贵。
replaceRange
editor.replaceRange(myString, CodeMirror.Pos(editor.lastLine()))