CKEditor React Image Resize 插件

Bur*_*fat 5 javascript ckeditor reactjs ckeditor5 ckeditor5-react

如何在 React 中使用 ImageResize。我找不到任何样本。我想调整我从 CKEditor 添加到我的反应组件上的图像的大小。

<CKEditor editor={ClassicEditor}
      data="<p>Hello from CKEditor 5!</p>"
      onInit={editor => {
        editor.plugins.get(
          "FileRepository"
        ).createUploadAdapter = loader => {
          return new UploadAdapter(loader)
        }

        //editor.plugins.add("ImageResize") or something?

        console.log("Editor is ready to use!", editor)
      }}
      onChange={(event, editor) => {
        const data = editor.getData()
        console.log({ event, editor, data })
      }}
      onBlur={(event, editor) => {
        console.log("Blur.", editor)
      }}
      onFocus={(event, editor) => {
        console.log("Focus.", editor)
      }}
/>
Run Code Online (Sandbox Code Playgroud)

小智 0

editor.plugins 有一个方法init( plugins, [ removePlugins ] ) \xe2\x86\x92 Promise.<LoadedPlugins> that initializes a set of plugins and adds them to the collection.

\n\n

https://ckeditor.com/docs/ckeditor5/latest/api/module_core_plugincollection-PluginCollection.html

\n