ueditor 工具栏配置_UEditor定制工具栏

第一步:方法1,修改 ueditor.config.js 里面的 toolbars

第一个位置,全屏的意思,然后我们把它去掉,打开百度ueditor编辑器的jsp界面,我们可以看到全屏的放大镜图标已经没有了。

第二步:方法2,实例化编辑器的时候传入 toolbars 参数,本人比较推荐此方法,不用修改百度编辑器的核心配置js文件最好。

打开ueditor.jsp界面(案例初始化百度编辑器的新建界面,读者可自行新建),我们可以看到,初始化ueditor的代码为:

var ue = UE.getEditor('container');

1,toolbars 简单列表

toolbars: [

['fullscreen', 'source', 'undo', 'redo', 'bold']

]

2,toolbars 多行列表

toolbars: [

['fullscreen', 'source', 'undo', 'redo'],

['bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc']

]

3,修改初始化编辑器代码var ue = UE.getEditor(‘container’)为

var ue = UE.getEditor('container', {

toolbars: [

['fullscreen', 'source', 'undo', 'redo', 'bold']

]

});

3,修改初始化编辑器代码var ue = UE.getEditor(‘container’)为

var ue = UE.getEditor('container', {

toolbars: [

['fullscreen', 'source', 'undo', 'redo'],

['bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc']

]

});


版权声明:本文为weixin_39931923原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。