Agontuk/vue-cropperjs

[fix]: i don't see any Events Support

zhougonglai opened this issue ยท 7 comments

h('img', {
      ref: 'img',
      attrs: {
        src: this.src,
        alt: this.alt || 'image',
        style: 'max-width: 100%'
      },
    nativeOn: {  // missing this
      ready: this.ready,
      cropstart: this.cropstart, // ...
    },
      style: this.imgStyle
    })]

These events are provided with props but not on Cropper Element

+1 I need this so I can pass context with the cropend event.

+2 they supposed to be events not as props.
it would be nice if they are like this.

<vue-cropper
  @ready="readyFired"
  @cropstart="cropstartFired"
  @cropmove="cropmoveFired"
  @cropend="cropendFired"
  @crop="cropFired"
  @zoom="zoomFired">
</vue-cropper>

Yes +1, cropperjs shows it has events

https://github.com/fengyuanchen/cropperjs#events

but v-on:event or @event dont work with them!

I've sent a pull request to fix this issue, but the owner is not here ๐Ÿ™„!
Pull request: #63
Commit: bd0be38

@themustafaomar Awesome man! Was thinking of going in there myself to make a pull request like you have. Let's urge @Agontuk to merge

In case this never gets committed you can use .native modifier to hook into cropperjs event:
@crop.native="crop($event)"

Event support added in v4.1.0