xyxiao001 / vue-cropper

A simple picture clipping plugin for vue
https://github.xyxiao.cn/vue-cropper/docs/vue3.html
MIT License
4.3k stars 695 forks source link

Can I contribute or can you create a feature? #176

Closed felipemengatto closed 5 years ago

felipemengatto commented 5 years ago

Hello, how are you? I would like to contribute a new part in your code, creating an event only for when it is happening "Move Crop", how can I build with code? or can you do this for the community?

Currently I made a Fork of the project and there I implemented it. However it would be very useful to have this default.

I'll leave here the place where I put the codes:

cropMove(e) {
 ...
  newX = x - this.cropOffsertX;
  newY= y - this.cropOffsertY;
  this.cropX = newX
  this.cropY = newY
  // on here
  this.$emit('movingCrop', true);
},

And

leaveCrop(e) {
  // on here
  this.$emit('movingCrop', false);
  ...
}

can you help me?

xyxiao001 commented 5 years ago

Do you want to trigger events when moving the crop box?

felipemengatto commented 5 years ago

That's right, it's very useful for me this function, because then I know exactly when the user starts moving the cut and ends it. No interference from any other situation.

xyxiao001 commented 5 years ago

Ok I will add it as soon as possible.

felipemengatto commented 5 years ago

Thank you Friend, you are incredible! and the Vue-cropper too!

xyxiao001 commented 5 years ago

I added at 0.37 version, you should update it

xyxiao001 commented 5 years ago

methods @cropMoving dataType { moving: true, // moving axis: { x1: 1, x2: 1, y1: 1, y2: 1 } }

felipemengatto commented 5 years ago

Thanks, friend I'll update now! As soon as the company's application goes to the air, I advise you to take a look at your component running the other side of the world :) Thanks again! Great week.

xyxiao001 commented 5 years ago

Very happy that you use