【问题标题】:Why the font color setting button does not shown in Ckeditor4 Tool bar?为什么Ckeditor4工具栏中没有显示字体颜色设置按钮?
【发布时间】:2023-01-11 16:05:10
【问题描述】:

我希望编辑器让用户更改编辑器的内容文本颜色。

这是我的代码:

import { CKEditor } from 'ckeditor4-react';
export default function Editor() {

let config={
    toolbar: [
        [ 'Source' ],
        [ 'Styles', 'Format', 'Font', 'FontSize' ],
        [ 'Bold', 'Italic' ],
        [ 'Undo', 'Redo' ],
        ['TextColor', 'BGColor'],
        [ 'About' ]
    ],
    extraPlugins: 'easyimage',
    removePlugins: 'image',
    cloudServices_uploadUrl: 'https://33333.cke-cs.com/easyimage/upload/',
    cloudServices_tokenUrl:
        'https://33333.cke-cs.com/token/dev/ijrDsqFix838Gh3wGO3F77FSW94BwcLXprJ4APSp3XQ26xsUHTi0jcb1hoBt'
}
let hello=()=>{
    console.log("hoi");
}

return (
    <CKEditor
        config={config}
        initData="<p>Hello from CKEditor 4!</p>"
        onBlur={hello}
        onInstanceReady={() => {
            console.log('Editor is ready!');
        }}
    />
)
}

但是,字体颜色设置按钮没有显示在 Ckeditor4 工具栏中。

你能告诉我如何解决这个问题吗?

【问题讨论】:

    标签: reactjs ckeditor4.x


    【解决方案1】:
    extraPlugins: ['easyimage', 'colorbutton'],
    

    【讨论】:

      【解决方案2】:

      什么……

      只需添加以下语句即可启用颜色按钮。

      config.extraPlugins = 'colorbutton';
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2023-03-11
        • 1970-01-01
        • 1970-01-01
        • 2015-05-13
        • 1970-01-01
        • 2021-08-18
        • 1970-01-01
        • 2019-09-25
        相关资源
        最近更新 更多