我有一个反应丰富的文本编辑器。我想显示选项工具栏。我正在查找显示名称对齐(证明)法老。我试图找到关于这方面的文件,但没有得到任何有用的信息。
例如:历史编辑将具有显示名为"HISTORY_BUTTONS“
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'}
]
}我想找一下医药的显示名称。

非常感谢!
发布于 2022-08-02 11:15:42
我遇到了同样的问题,并在这里找到了我需要的解决方案,论react rte github
所以你需要做的是把你的toolbarConfig变成
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" },
],
};对于显示、保存和导入对齐数据,请访问本期
https://stackoverflow.com/questions/72657781
复制相似问题