正如标题所说,是否有在初始化后添加颜色quill
?我可以访问编辑器变量。
var Colors = ['black','white];
// ...
var TOOLBAR_CONFIG = [
['bold', 'italic', 'link', { 'color': Colors }, { 'list': 'bullet' },
{ header: 1 }, { header: 2 }, 'image'
]];
QuillEditor = new Quill('#'+this.props.id, {
bounds: '.cnt',
theme: 'bubble',
modules: {
toolbar: TOOLBAR_CONFIG
}
});
// ...
// Somewhere else in a action listen i would like to add a custom color, e.g:
myhandle(){
Colors.push('blue');
// I tried looking at QuillEditor.getModule('toolbar'); but could not see any event?
}
谢谢