我正在使用codemirror 2并且它工作正常,除了编辑器的设置值没有加载到编辑器中,直到我单击编辑器并且它变得集中.
我希望编辑器在不必点击的情况下显示自己的内容.有任何想法吗?
所有的codemirror演示都按预期工作,所以我想也许textarea没有集中,所以我也尝试过.
$("#editor").focus();
var editor = CodeMirror.fromTextArea(document.getElementById("editor"), {
mode: "text/html",
height: "197px",
lineNumbers: true
});
Run Code Online (Sandbox Code Playgroud)