Ckeditor 在CK编辑器中使用类名设置插件工具栏图标

Ckeditor 在CK编辑器中使用类名设置插件工具栏图标,ckeditor,ckeditor4.x,Ckeditor,Ckeditor4.x,如何使用类名(而不是使用图像URL)设置插件和/或小部件工具栏按钮图标?我发现了一个漏洞,用于解决这个看似明显缺失的功能: editor.ui.addButton('MyButton', { //className: '...' // this only adds the classes to the parent container, not the icon span icon: '_ fa fa-scissors _' // this hacks the existing

如何使用类名(而不是使用图像URL)设置插件和/或小部件工具栏按钮图标?

我发现了一个漏洞,用于解决这个看似明显缺失的功能:

editor.ui.addButton('MyButton', {
    //className: '...' // this only adds the classes to the parent container, not the icon span
    icon: '_ fa fa-scissors _'  // this hacks the existing classes and injects extra classes to the icon span
});

使用CK Editor v4.6.2进行了测试,我不完全确定我是否理解这个问题,但我使用了这个技巧,它非常接近我要做的事情,只是我只需要在插件中的一个新按钮上使用它。这是否意味着没有官方的方式来做这件事?例如,我期望像
CKEDITOR.plugins.add(“myplugin”、{className:“fa-fa-scissors”、…}
这样的东西可以做到这一点。这很简单!从未想过这样做。