CroudTech / vue-quill

Quill component for vue
MIT License
121 stars 22 forks source link

handlers don't seem to be working #29

Open igasparetto opened 5 years ago

igasparetto commented 5 years ago

I need to implement something similar to what is described here: https://github.com/zenoamaro/react-quill/issues/111

https://codepen.io/alexkrolick/pen/gmroPj?editors=0010

BrockReece commented 5 years ago

Ok, so what seems to be the issue?

igasparetto commented 5 years ago

Sorry, I should have been more descriptive.

I am trying to add a button myCustomButton that will open a modal. From what I understood and following the example above, one way to bind an event to the button is through handlers.

I assume handlers should go somewhere in the config object below, but where? The toolbar is an array of buttons. I am confused.

Would be good to add handlers to the docs as well...

    return {
      content: {
        ops: [],
      },
      config: {
        readOnly: false,
        modules: {
          toolbar: [
           ....
            ['myCustomButton' ],
           ....
          ]
        }
      }
    }
  }

Thanks

BrockReece commented 5 years ago

I have built a codepen to illustrate how you can pass the toolbar config as an object and add handlers that way. You should be able to use this idea in the config prop on the vue-quill wrapper component.

https://codepen.io/BrockReece/pen/dwmNyX?editors=0010