📜  如何在 Bootstrap Modal 中应用 CodeMirror - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:41.599000             🧑  作者: Mango

代码示例1
var myCodeMirror = CodeMirror(document.querySelector('.codemirror-init'), {
  value: 'Your Value',
  lineNumbers: true,
  tabSize: 2,
  mode: 'javascript',
  theme: 'monokai'
});

$('#exampleModal').on('shown.bs.modal', function() {
    // Refresh Code mirror Here
       myCodeMirror.refresh();
});