2

我试图将我的 CKEditor 5 工具栏分成两部分,彼此相距很远。这是我的实际工具栏:

在此处输入图像描述

使用以下 html 呈现的代码:

在此处输入图像描述

我想要的是这样的:

toolbar: [
  'heading',
  'bold',
  'italic',
  'underline',
  '=', // this is the delimiter 
  'alignment:left',
  'alignment:right',
  'alignment:center'
],

我想根据该分隔符生成此代码:

<div style="display: flex; flex-direction: row; justify-content: space-between;">
    <div>
        <!-- part 1 before the = -->
    </div>
    <div>
        <!-- part 2 after the = -->
    </div>
</div>

我不知道如何实现这一目标。有人有想法吗?

4

2 回答 2

0

当前ToolbarView不支持拆分为多行。

我可以想到两个非常简单的选择:

  1. 扩展ToolbarView以便它可以做这样的事情,或者直接在你自己的Editor类中使用它,或者注入它而不是原始的ToolarView,就像你可以注入你自己的图标一样。
  2. 填充两个单独的工具栏实例并在您自己的编辑器类中使用它们。

顺便说一句,您可以用作基础的最简单的编辑器实现是DecoupledEditor您可以在这里看到的:https ://docs.ckeditor.com/ckeditor5/latest/examples/builds/document-editor.html

于 2018-06-01T14:07:54.357 回答
0

如果您希望实施此功能,请在https://github.com/ckeditor/ckeditor5/issues/6146中跟踪此问题。

于 2020-09-25T06:23:19.487 回答