How to determine if CKEditor is loaded?

前端 未结 7 1495
野性不改
野性不改 2021-02-18 16:16

How do I find out if CKEditor is loaded? I\'ve looked through the API docs, but could only find the loaded event. I want to check if CKEditor is loaded, because if I load it a s

7条回答
  •  时光说笑
    2021-02-18 16:45

    If instance is not ready, the text set would be discarded

    On initialization of the CkEditor (version 4 here), you should never set any data before the editor is ready to handle it.

    // Initialize this._editor with replace
    
    if (this._editor.status !== "ready") {
        this._editor.on("instanceReady",
            event => {
                event.editor.setData(data);
            });
    } else {
        this._editor.setData(data);
    }
    

提交回复
热议问题