代码
tinymce.init({
selector: '#editor',
toolbar: 'myCustomToolbarButton',
setup: function (editor) {
editor.ui.registry.addButton('myCustomToolbarButton', {
text: 'My Custom Button',
onAction: function () {
alert('Button clicked!');
}
});
}
});
效果
官网参考
https://www.tiny.cloud/docs/ui-components/toolbarbuttons/#