Tinymce 4.2.0 got Cannot read property 'setContent' of null

后端 未结 3 708
逝去的感伤
逝去的感伤 2021-01-20 10:48

I got Cannot read property \'setContent\' of null, when i want to using setContent function. Intended for set value in text editor generated by Tinymce library. Is am wrong

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-20 11:49

    Real late to the party, but tinyMCE.init also has setup configuration option which allows to add any event handlers to the specific editor being initialised:

    tinymce.init({
            setup: editor => {
                editor.on('init', () => {
                    editor.setContent('custom');
                });
            }
        });
    

提交回复
热议问题