当我使用它时,我只得到了类构建视图,我也试着从包中安装和使用DecoupleEditor,它只显示了classis构建视图,从DecoupleEditor导入DecoupledEditor
import { CKEditor } from "@ckeditor/ckeditor5-react";
import Editor from "ckeditor5-custom-build/build/ckeditor";
function App() {
let editorr = null;
return (
<div className="App">
<CKEditor
onReady={(editor) => {
console.log("Editor is ready to use!", editor);
editor.ui
.getEditableElement()
.parentElement.insertBefore(
editor.ui.view.toolbar.element,
editor.ui.getEditableElement()
);
editorr = editor;
}}
onError={(error, { willEditorRestart }) => {
if (willEditorRestart) {
editorr.ui.view.toolbar.element.remove();
}
}}
onChange={(event, editor) => console.log({ event, editor })}
editor={Editor}
data="<p>Hello from CKEditor 5's decoupled editor!</p>"
/>
</div>
);
}
export default App;文件夹结构在这里输入图像描述
发布于 2022-09-16 07:09:49
找到答案后,我需要添加文档编辑器CSS文件来查看更改。
https://stackoverflow.com/questions/72919433
复制相似问题