首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >rte rte:在toolbarConfig上显示对齐按钮的名称

rte rte:在toolbarConfig上显示对齐按钮的名称
EN

Stack Overflow用户
提问于 2022-06-17 10:14:39
回答 1查看 225关注 0票数 0

我有一个反应丰富的文本编辑器。我想显示选项工具栏。我正在查找显示名称对齐(证明)法老。我试图找到关于这方面的文件,但没有得到任何有用的信息。

例如:历史编辑将具有显示名为"HISTORY_BUTTONS“

代码语言:javascript
复制
const toolbarConfig = {
    // Optionally specify the groups to display (displayed in the order listed).
    display: ['INLINE_STYLE_BUTTONS', 
              'BLOCK_TYPE_BUTTONS', 
              'LINK_BUTTONS', 
              'BLOCK_TYPE_DROPDOWN', 
              'HISTORY_BUTTONS'],
    INLINE_STYLE_BUTTONS: [
      {label: 'Bold', style: 'BOLD', className: 'custom-css-class'},
      {label: 'Italic', style: 'ITALIC'},
      {label: 'Underline', style: 'UNDERLINE'}
    ],
    BLOCK_TYPE_DROPDOWN: [
      {label: 'Normal', style: 'unstyled'},
      {label: 'Heading Large', style: 'header-one'},
      {label: 'Heading Medium', style: 'header-two'},
      {label: 'Heading Small', style: 'header-three'}
    ],
    BLOCK_TYPE_BUTTONS: [
      {label: 'UL', style: 'unordered-list-item'},
      {label: 'OL', style: 'ordered-list-item'}
    ]
  }

我想找一下医药的显示名称。

非常感谢!

EN

回答 1

Stack Overflow用户

发布于 2022-08-02 11:15:42

我遇到了同样的问题,并在这里找到了我需要的解决方案,论react rte github

所以你需要做的是把你的toolbarConfig变成

代码语言:javascript
复制
 const toolbarConfig = {
  display: [
    "INLINE_STYLE_BUTTONS",
    "BLOCK_TYPE_BUTTONS",
    "BLOCK_ALIGNMENT_BUTTONS",
    "LINK_BUTTONS",
    "BLOCK_TYPE_DROPDOWN",
    "HISTORY_BUTTONS",
  ],
  INLINE_STYLE_BUTTONS: [
    { label: "Bold", style: "BOLD", className: "custom-css-class" },
    { label: "Italic", style: "ITALIC" },
    { label: "Underline", style: "UNDERLINE" },
  ],
  BLOCK_TYPE_DROPDOWN: [
    { label: "Normal", style: "unstyled" },
    { label: "Inline Title", style: "header-three" },
  ],
  BLOCK_TYPE_BUTTONS: [
    { label: "UL", style: "unordered-list-item" },
    { label: "OL", style: "ordered-list-item" },
  ],
  BLOCK_ALIGNMENT_BUTTONS: [
    { label: "Align Left", style: "ALIGN_LEFT" },
    { label: "Align Center", style: "ALIGN_CENTER" },
    { label: "Align Right", style: "ALIGN_RIGHT" },
    { label: "Align Justify", style: "ALIGN_JUSTIFY" },
  ],
};

对于显示、保存和导入对齐数据,请访问本期

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72657781

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档