docs
富文本编辑器

npm 模块

slate (opens in a new tab)

  1. 数据结构 (opens in a new tab)

  2. 自定义标签渲染 (opens in a new tab)

  3. 清空编辑器

const clearEditor = (editor: BaseEditor & ReactEditor) => {
  editor.children.forEach(() => {
    Transforms.removeNodes(editor, { at: [0] });
  });
};
  1. 编辑器插入
Transforms.insertNodes(editor, nodes);

quilljs (opens in a new tab)

typist (opens in a new tab): 基于 Tiptap 的编辑器。GitHub starslast commitnpm downloads