Agontuk / vue-cropperjs

A Vue wrapper component for cropperjs https://github.com/fengyuanchen/cropperjs
MIT License
932 stars 225 forks source link

:zoom Event not attaching correctly #24

Closed MichaelJWallis closed 6 years ago

MichaelJWallis commented 7 years ago

I have a cropper in a component like so:

<vue-cropper :ref="'cropper'" :src="imgSrc" :zoom="testMethod" :view-mode="3" :guides="false" :background="false" :drag-mode="'move'" :auto-crop-area="1" :crop-box-movable="false" :crop-box-resizable="false"></vue-cropper>

And then a test method I'm using which is as follows:

testMethod() {
            console.log('Working');
            var currentWidth = this.$refs.cropper.getCanvasData().width;
            console.log(currentWidth);
        }  

If I use any of the cropmove, start or end methods the function fires and I get the logged output, however when I use zoom I get nothing.

I'm using Chrome version 59.0.3071.115 (Official Build) (64-bit) on a Macbook Pro running Sierra. I've tested zooming with both the mouse wheel and the trackpad

Agontuk commented 7 years ago

zoom event is currently disabled I think. I faced an issue while updating this library for Vue 2.0, so disabled it back then. I'll take a look to see if I can fix it.

MichaelJWallis commented 7 years ago

Great! Thanks

Agontuk commented 7 years ago

I pushed a fix in the master branch. Can you check if it works for you, I'll then update the npm version.

Agontuk commented 6 years ago

zoom event should work now, so closing this.