chenjuneking / quill-image-drop-and-paste

A quill editor module for drop and paste image, with a callback hook before insert image into the editor
ISC License
105 stars 44 forks source link

feat: allow access to module instance in handler function #5

Closed marshtomp closed 4 years ago

marshtomp commented 4 years ago
function imageHandler(imageDataUrl, type) {
  // access to quill instance
  const quill = this.quill

  callUploadAPI(your_upload_url, formData, (err, res) => {
    quill.insertEmbed(index, 'image', res.data.image_url, 'user')
  })
}