簡體   English   中英

我正在嘗試實現解耦文檔 ckeditor5 以與自定義構建插件做出反應,但我總是看到 classis 構建編輯器

[英]I am trying to implement decoupled document ckeditor5 in react with custom build plugins but i am always seeing classis build editor

當我使用它時,我只獲得了 classis 構建視圖,我已經嘗試從 package 安裝和使用 DecoupleEditor,它只顯示 classis 構建視圖 import DecoupledEditor from '@ckeditor/ckeditor5-build-decoupled-document';

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;

文件夾結構在此處輸入圖像描述

前端視圖

找到答案我需要添加文檔編輯器CSS文件來查看更改。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM