自定义按钮的文本,这可能不是标准做法,但也很简洁。
TinyMCE 6
tinymce.init({
...
setup: (editor) => { // 自定义工具栏按钮
editor.ui.registry.addButton('codesampleplus', {
icon: "code-sample",
text: 'Insert/Edit code sample',
title: "Insert/Edit code sample",
tooltip: 'Insert/Edit code sample',
onAction: (_) => editor.execCommand('CodeSample') // 执行命令
});
},
})
效果