Agontuk/vue-cropperjs

error in build app while using typescript

ProMasoud opened this issue · 4 comments

Hi,
Thanks for your awesome work on cropper.js wrapper

I have problem with this plugin while using TypeScript.
The problem is plugin not support typescript and I have error in build and deploy my app

image

I'll try to add typescript support, also PR is welcome.

rcart commented

Hi @ProMasoud , were you able to tackle this issue with a solution/workaround? I'm experiencing the exact same scenario as you did.

Hi @rcart
Yes I simply did this. It 's not a good idea but working.

  public cropImage(): void {
    this.cropImg = (this.$refs.cropper as any).getCroppedCanvas().toDataURL();
    this.form.avatar = this.cropImg;
    this.dialog = false;
  }
rcart commented

Cool. That did the trick @ProMasoud. Thanks a lot.