gpt4 book ai didi

javascript - 'ckeditor4-react' 和 'HTML5 video' 插件

转载 作者:行者123 更新时间:2023-12-05 06:55:48 30 4
gpt4 key购买 nike

我要添加html5video plugin到我的 CKEditor 组件。我使用 "ckeditor4-react": "^1.1.0" 这是我的组件:

import React, { useState, FunctionComponent }   from "react";
import CKEditor from "ckeditor4-react";

export interface CreateNewArticleProps {}

const CreateNewArticle: FunctionComponent<CreateNewArticleProps> = () => {
const [articleFormData, setArticleFormData] = useState({
articleBody: "",
});

const ckeditorConfig = {
extraPlugins: "justify, colorbutton, font",
};
const ckeditorDataChangeHandler = (event) => {
setArticleFormData({
...articleFormData,
articleBody: event.editor.getData(),
});
};

return (
<CKEditor
type="classic"
config={ckeditorConfig}
data={articleFormData.articleBody}
onChange={ckeditorDataChangeHandler}
/>
);
};
export default CreateNewArticle;

我不知道如何将 html5video 插件 添加到 CKEditor。

最佳答案

CKEditor 4 React 组件假设在创建任何 CKeditor 组件之前加载了 CKEditor。这样就可以传URL to custom build of CKEditor每个需要的插件:

CKEditor.editorUrl = 'https://your-website.example/ckeditor/ckeditor.js';

要将插件加载到编辑器的实例中,pass config prop to the component :

    <CKEditor
config={ {
extraPlugins: 'extra,plugins'
} }
/>

关于javascript - 'ckeditor4-react' 和 'HTML5 video' 插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65276219/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com