Agontuk/vue-cropperjs

replace() function doesn't work with the last version of Cropper JS

ethanS06 opened this issue · 1 comments

In the last version of Cropper JS, the replace() method of Cropper takes only 1 parameter (url) instead of 2 as used in the VueCropper.js file.
Cropper JS method :

 replace: function replace(url)

VueCropper JS method :

replace: function replace(url) {
      var onlyColorChanged = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

      return this.cropper.replace(url, onlyColorChanged);

To fix that, replace the definition of replace from VueCropperJS by the definition below:

replace: function replace(url) {
    return this.cropper.replace(url);
    }

sorry for the late response, which cropperjs version are you using ? This library supports v1.5.x and replace method has two parameters.

https://github.com/fengyuanchen/cropperjs/blob/main/src/js/methods.js#L95