【问题标题】:How can i implement ImageResize plugin to ckeditor 5 in reactjs我如何在 reactjs 中实现 ImageResize 插件到 ckeditor 5
【发布时间】:2022-11-04 18:03:29
【问题描述】:

我使用 ckeditor5 documentation 来导入 ckeditor5 react 组件。这是我的代码:

<CKEditor
                    editor={ClassicEditor}
                    data=""
                    config={custom_config}
                    onReady={editor => {
                      // You can store the "editor" and use when it is needed.
                      // console.log('Editor is ready to use!', editor);
                    }}
                    onChange={(event, editor) => {
                      const data = editor.getData();
                      console.log({ event, editor, data });
                      this.setState({ content: data })
                    }}
                    onBlur={(event, editor) => {
                      // console.log('Blur.', editor);
                    }}
                    onFocus={(event, editor) => {
                      // console.log('Focus.', editor);
                    }}
                  />

这是我的 custom_config :

const custom_config = {
  extraPlugins: [MyCustomUploadAdapterPlugin],
  toolbar: {
    items: [
      'heading',
      '|',
      'bold',
      'italic',
      'link',
      'bulletedList',
      'numberedList',
      '|',
      'blockQuote',
      'insertTable',
      '|',
      'imageUpload',
      'undo',
      'redo'
    ]
  },
  image: {
      toolbar: [
          'imageStyle:inline',
          'imageStyle:block',
          'imageStyle:side',
          '|',
          'toggleImageCaption',
          'imageTextAlternative'
      ]
  },
  table: {
    contentToolbar: ['tableColumn', 'tableRow', 'mergeTableCells']
  }
}

我想添加 ImageResize 插件,但在文档中它没有显示如何为 React 导入。您可以在here 中找到文档

我尝试像这样导入extraPlugins:

extraPlugins: [MyCustomUploadAdapterPlugin, ImageResize],

但它给出错误

我在文档中找不到如何正确处理 React 组件。

【问题讨论】:

    标签: reactjs ckeditor ckeditor5


    【解决方案1】:

    你有没有找到任何解决方案?

    【讨论】:

    • 这篇文章看起来不像是试图回答这个问题。这里的每一篇文章都应该是明确的尝试回答这个问题;如果您有批评或需要澄清问题或其他答案,您可以在其下方直接post a comment(如这个)。请删除此答案并创建评论或新问题。见:Ask questions, get answers, no distractions
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-08-03
    • 2021-08-09
    • 1970-01-01
    • 1970-01-01
    • 2020-02-17
    • 2019-04-18
    • 1970-01-01
    相关资源
    最近更新 更多