![](/img/trans.png)
[英]React.js CKEditor5 component - problem in creating the component
[英]Adding font color in CkEditor5 react js
我在 reactJs 中使用帶有經典編輯器和上傳插件的 CKeditor5。我想在文本編輯器中添加字體顏色功能。 根據文檔,我嘗試安裝和使用@ckeditor/ckeditor5-font,但它給我錯誤“ckeditor-duplicated-modules”。 如何在文本編輯器中添加字體顏色?
import { CKEditor } from "@ckeditor/ckeditor5-react";
import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
<CKEditor
config={{
extraPlugins: [uploadPlugin],
}}
editor={ClassicEditor}
data={value}
// onInit={(editor) => {}}
onReady={(editor) => {}}
onChange={this.handleCk5change}
className="ckeditor-custom"
/>
您可以創建一個 css 文件並像這樣設置 .ck.ck-content class 的顏色屬性:
.ck.ck-content{
color: red !important;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.