Rebbeca
Rebbeca

Reputation: 1987

What should I put in the imageUpload of the redactor Parameter?

I currently use vue for frontend and django for backend. I'm using the editor of the redactor in the frontend vue, but I don't know what to put in the imageUpload. Should I put backend's API? This is my current code.

  configOptions = {
    buttons: ['format', 'bold', 'italic', 'lists', 'link', 'image', 'file'],
    plugins: ['imagemanager', 'filemanager']
    imageUpload:
      'http://backend-url/image/',
    imageData: {
      id: 10,
      elements: '#my-input, #my-form'
    }
  }

Upvotes: 0

Views: 196

Answers (1)

Vincent
Vincent

Reputation: 1564

You can use imageUpload to upload an image inline with the text. To add an image, you can add a function to imageUpload that submits the image to your database or vuex store. For example;

imageUpload: (data, files, e, upload) => {
    // commit to your vuex store, or do a post request to your API url.                  
},

Upvotes: 1

Related Questions