fengyuanchen / cropperjs

JavaScript image cropper.
https://fengyuanchen.github.io/cropperjs/
MIT License
12.98k stars 2.4k forks source link

photo-editor在线案列,拖动截图框,会偶尔出现重影?在Vue中使用,也会出现这种情况 #246

Closed xyhxyw closed 6 years ago

xyhxyw commented 6 years ago

Vue:2.5.2 Chrome版本:60 引入cropperjs(cropper.js本地文件):

import Cropper from './cropper.js';
import './cropper.css';

调用cropper.setDragMode('crop'),拖动截图框的几个角,经常会出现重影的 情况。

1

使用photo-editor的在线案列,当拖动缓慢时,也会偶尔出现重影的情况 cropper bug2

Vue组件内容入下: template代码:

<div class="content canvas">
        <img :src="src" alt="" id="image">
  </div>

script代码(在mounted钩子函数中执行如下代码):


var image = document.getElementById('image');
this.cropper = new Cropper(image, {
    autoCrop:false,
    dragMode:'move',
    background: false,
    viewMode: 1,
    cropend(){
        //_this.cropper.setDragMode('move');
    },
    ready(){

    }
});

执行crop操作代码: ` this.cropper.setDragMode("crop");

`

fengyuanchen commented 6 years ago

Check out this: https://github.com/fengyuanchen/cropper/issues/921