CKEditor 富文本编辑器

GitHub 项目地址 文档

引用

// CKEditor 5
<script src="https://cdn.ckeditor.com/ckeditor5/16.0.0/classic/ckeditor.js"></script>
<script src="https://cdn.ckeditor.com/ckeditor5/16.0.0/balloon/ckeditor.js"></script>
<script src="https://cdn.ckeditor.com/ckeditor5/16.0.0/balloon-block/ckeditor.js"></script>
<script src="https://cdn.ckeditor.com/ckeditor5/16.0.0/inline/ckeditor.js"></script>
<script src="https://cdn.ckeditor.com/ckeditor5/16.0.0/decoupled-document/ckeditor.js"></script>
<div id="editor">
    <p>Here goes the initial content of the editor.</p>
</div>

然后调用ClassicEditor.create()来代替的 <textarea> 一个元素经典的编辑器:

经典编辑器

ClassicEditor.create( document.querySelector('#editor') ).then( editor => {
    console.log( editor );
}).catch( error => {
    console.error( error );
});

内联编辑器

InlineEditor.create( document.querySelector('#editor') ).then( editor => {
    console.log( editor );
}).catch( error => {
    console.error( error );
});

气球编辑器

BalloonEditor.create( document.querySelector('#editor') ).then( editor => {
    console.log( editor );
}).catch( error => {
    console.error( error );
});
赞(1) 打赏
取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

    暂无评论...