function initCKEditor(querySelector,content_val,myEditor) {
    ClassicEditor.create(document.querySelector(querySelector), {
        toolbar: ["undo", "redo", "|", "alignment", "bold", "italic", "blockQuote", "imageTextAlternative", "imageUpload", "heading", "link", "numberedList", "bulletedList"],
        ckfinder: {
            uploadUrl: '/admin.php/Common/ck_editor?command=QuickUpload&type=Files&responseType=json'
        }
    }).then(editor => {
        // 设置初始值
        editor.setData(content_val);
        window[myEditor] = editor;
    }).catch(error => {
        console.error(error);
    });
}

window[myEditor] = editor;
将传入的字符串,直接变量名使用!

相关文章:

  • 2021-10-08
  • 2022-12-23
  • 2021-09-19
  • 2022-12-23
  • 2021-09-29
  • 2021-07-08
  • 2022-02-12
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-24
  • 2021-09-07
  • 2021-05-26
相关资源
相似解决方案