Как добавить кнопку, со своим функционалом, в tinymce?

Как добавить в VUE, для текстового редактора tinymce, кастомную кнопку

template:

<tinymce
  id="d1"
  :other_options="options"
></tinymce>

script - in data:

options: {
  selector: '#d1',
  toolbar: 'customButton',
  setup(editor) {
    editor.addButton('customButton', {
      text: 'My button',
      icon: false,
      onclick() {
        editor.insertContent("&nbsp;<b>It's my button!</b>&nbsp;")
      },
    })
  },

или

setup:(editor) {
  editor.ui.registry.addButton('myCustomToolbarButton', {
    text: 'My Custom Button',
    onAction() {
      alert('Button clicked!');
    }
  });
}

Ничего из этого не работает, делал как в документации, может с vue есть какие то особенности, подскажите, кто знает.


Ответы (0 шт):