CKeditor5 自定义配置字体大小fontSize组件

位置:首页>文章>详情   分类: 教程分享 > WEB基础   阅读(1185)   2024-03-11 19:24:42

CKeditor5 默认情况下的fontsize组件是小号默认大号特大号这种,没有具体的字体大小px单位选择,有些时候需要配置。故而对默认配置进行了修改。

配置方式如下:

            ClassicEditor
                .create( document.querySelector( '#contentHtml' ), {
                    licenseKey: '',
                    //设置字体
                    fontSize: {
                        options: [
                            12,
                            14,
                            'default',
                            18,
                            25,
                            30
                        ]
                    },
                } )
                .then( editor => {
                    editor.setData($('#cocntentScript').html());
                    window.editor = editor;
                } )
                .catch( error => {
                    console.error( 'Oops, something went wrong!' );
                    console.error( 'Please, report the following error on https://github.com/ckeditor/ckeditor5/issues with the build id and the error stack trace:' );
                    console.warn( 'Build id: l1txv9x2i4j9-f8u2t0fifydx' );
                    console.error( error );
                } );


配置搞定

地址:https://www.leftso.com/article/1127.html

相关阅读

CKeditor5 默认情况下的fontsize组件是小号默认大号特大号这种,没有具体的字体大小px单位选择,有些时候需要配置。故而对默认配置进行了修改。配置方式如下: C...
CKeditor无论那个版本,在我主要以文章编辑的时候,需要去掉默认的H1标签,所以需要自定义配置heading标签。同样CKeditor5 与之前的4版本有所不同。CKeditor5自定义配置...
ckeditor5 图片上传地址配置,ckeditor5和4的图片上传配置有点不一样。首先是确定你选的上传支持插件是什么,我这里是下面这个插件ckfinder upload adapter以次控...
在CKEditor4版本中,对于编辑器高度设置是通过config配置里面的属性height来实现的,如下方所示CKEditor5 版本查文档发现已经没有这个配置了,通过网络资料查询得知,CKEd...
CKeditor5代码片段是官方自己集成的。可以通过在线构建的时候选择Code blocks 组件。选择后默认支持一下代码语言,是通过pre标签+code标签实现的。[ { langu...
在ckeditor4的时候绑定blur事件代码如下:window.editor.on('blur',function(){//这里写你想做的事儿})同样的代码搬到ckeditor5不仅不能用,还...
CKEditor 5 不重新构建移除某个plugin控件组件参考代码:ClassicEditor .create( document.querySelector...
summernote 粘贴图片上传到服务器以下为关键代码//初始化富文本 $('#description').summernote('destroy'); ...
方案一$("#dialog-modal").modal({backdrop:"static",//点击空白处不关闭对话框show:false,//按esc键盘不关闭.})方案二在弹框元素(下面以...
npm配置国内镜像源