自定义ueditor组件

版权声明:@渔闻520 https://blog.csdn.net/weixin_41060905/article/details/83410868

先罗列一些常用的功能:

'redo', //重做 'snapscreen', //截图 'bold', //加粗'horizontal', //分隔线
 'cleardoc', //清空文档'fontfamily', //字体  'forecolor', //字体颜色
        'fontsize', //字号   'simpleupload', //单图上传
        'insertimage', //多图上传 'emotion', //表情  'map', //Baidu地图
  'insertvideo', //视频 'attachment', //附件

使用的时候,可以修改配置文件,也可以在实例化时传入,这里推荐使用实例化时传入。

看例子:

var ue = UE.getEditor('editor', {
    toolbars: [
        ['fullscreen', 'source', 'undo', 'redo', 'bold']
    ],
    autoHeightEnabled: true,//设置是否可以根据文本框的内容来调整编辑器的高度
    autoFloatEnabled: true//设置可以自动浮动
});

另外,还有两个参数可以调节编辑器的大小:

initialFrameWidth {Number} [默认值:1000] //初始化编辑器宽度,默认1000

initialFrameHeight {Number} [默认值:320] //初始化编辑器高度,默认320

其他请移步官方文档:http://fex.baidu.com/ueditor/#start-config

猜你喜欢

转载自blog.csdn.net/weixin_41060905/article/details/83410868