1
arrow8899 2019-07-12 20:47:29 +08:00
require.js
|
2
GTim 2019-07-12 23:10:26 +08:00
详细点的呢看这个网页的源代码 [https://www.twle.cn/t/yufei/c/helloworld]( https://www.twle.cn/t/yufei/c/helloworld)
不那么详细的呢就是添加下面的设置即可,比如 C 语言 var var editor = CodeMirror.fromTextArea('xx'); var ext = "c"; var info = CodeMirror.findModeByExtension(ext); var mode = ""; var spec = ""; if (info) { mode = info.mode; spec = info.mime; } if (mode) { editor.setOption("mode", spec); CodeMirror.autoLoadMode(editor, mode); } |