Giter VIP home page Giter VIP logo

acccccccb / vue-img-cutter Goto Github PK

View Code? Open in Web Editor NEW
477.0 5.0 76.0 1.3 MB

简单易用的vue图片裁剪插件,支持移动图像,裁剪图片,放大缩小图片,上下左右移动,固定比例,固定尺寸,远程图片裁剪,只需要很少的代码就可以实现裁剪功能,也可以通过调整参数以适应你自己的业务需求。

Home Page: https://www.ihtmlcss.com/demo/dist/#/croptool

License: MIT License

JavaScript 4.25% HTML 0.67% Vue 95.07%
vue vue-img-cutter image copper

vue-img-cutter's Issues

工具栏度数宽度不够

bug描述
详细描述bug是在什么操作下出现的,最好带上截图,如果可以线上预览,请附上链接
版本号
此bug出现在哪个版本
浏览器版本
IE/Edge/Firefox/Chrome
image

固定裁剪框位置时图片拖动优化建议

在项目中使用时,若固定裁剪框位置,当鼠标置于裁剪框区域内时,无法拖拽图片

建议在固定裁剪框位置时,给裁剪框容器增加:pointer-events: none 以便于拖拽图片

关于<template>中this的问题

image
image
你好,源码在template中使用props中的值时某些前面加了this(截图只是一个变量,还有其它的一些),使用时运行不了,去掉就可以运行,麻烦看一下可以吗?谢谢

原图裁剪?

你好,我在代码中发现了这些内容:
组件有originalGraphcuttingOriginal两个属性但是cuttingOriginal并没有被使用,请问是冗余字段还是我个人理解偏差?
然后想了解下originalGraph的具体内涵是什么?为什么会有裁剪原图的选项?

插件弹窗的标题

请问插件的标题,”图片裁剪“ 这几个字可以传插槽吗或者是可以配置国际化吗,没找到在哪可以配置

如果没有选取图片直接点击确定,也能触发裁剪函数

bug描述
完成截图:cutDown 回调,能够加入是否上传并且裁剪判断,我测试发现一个问题就是我没有上传图片直接可以点击确定按钮,并且在回调函数能取到值,只是没有fileName参数,我没有上传就不应该触发裁剪功能。这里我通过判断fileName能够阻止他的上传。但是有种情况就是我上传图片但是取消本次裁剪,因为浏览器的机制原因,input的files队列没有被清空,我再次打开裁剪,并且不上传图片,我点击裁剪的确定按钮过后获取的对象就会有fileName,这里我就没办反判断是否上传本次结果了,因为我没有办法监听input的change事件,所以我的图片裁剪我是没办法是否判断是否是有效裁剪。如果出现我上述问题就会出现一张空白图片.
版本号
最新版
浏览器版本
IE/Edge/Firefox/Chrome

I have a problem in dynamically change a cutwidth and cutheight. pls help to solve, and where is demo code?

I have a problem in dynamically change a cut width and cut height. pls help to solve, and where is the demo code?

I have used Vue js

<ImgCutter
      ref="imgCutterModal"
      class="ImgCutterBox"
      :label="$t('system.selectIMG')"
      :crossOrigin="true"
      crossOriginHeader="*"
      rate=""
      :tool="true"
      toolBgc="none"
      :cutWidth="cutWidth"
      :cutHeight="cutHeight"
      :sizeChange="false"
      :originalGraph="false"
      :boxWidth="modelWidth"
      :boxHeight="boxHeight"
      :isModal="false"
      :showChooseBtn="true"
      :moveAble="true"
      @cutDown="cutDown"
      @onClearAll="onClearAll"
      @onChooseImg="onChooseImg">
          <span class="btn btn-primary" slot="cancel" style="margin-right:10px;">
              <el-button>{{$t('system.cancel')}}</el-button>
          </span>
          <span class="btn btn-primary" slot="confirm">
              <el-button type="primary">{{$t('system.confirm')}}</el-button>
          </span>
</ImgCutter>

in props, I have received cut width and cut height. it will dynamically change.

确认提交,按钮type错误,会导致form表单触发默认提交事件

bug描述
确认裁剪图片时,按钮type为primary,这是element按钮type,会导致button按钮触发默认事件。应该是在组件传递参数的时候没有把type放入props内部,导致$attrs直接赋值在了button的原生type上,导致type默认为submit事件,如果裁剪框在form表单内部就会导致提交默认事件,页面会被刷新。
因为没有给出能够监听选中图片到裁剪框的钩子,所以使用“插槽”替换掉按钮之后没办法改变按钮颜色,只能用默认颜色。不能像原代码那样从白色变为蓝色。
版本号
2.1.3
浏览器版本
IE/Edge/Firefox/Chrome

能否开发适配i18n的版本呢

您好作者,首先感谢您的辛苦开发,我最近遇到一个需要国际化的网站要用到您的作品,能否开发一个支持i18n或者中英甚至多语言的版本呢?谢谢啦。

移动端无法移动

bug描述
详细描述bug是在什么操作下出现的,最好带上截图,如果可以线上预览,请附上链接
版本号
此bug出现在哪个版本
浏览器版本
IE/Edge/Firefox/Chrome

[feature]建议增加配置,当上传图片宽高度小于设定的不可调整裁剪宽高度时,直接执行上传不再执行裁剪

首先感谢提供这么好用的插件。
标题情况大多数情况下用在头像上传的时候。
我自己改的。参数名什么的随便加的。就不提pr了。

smallToUpload: {
  // 选择的图片宽高均小于裁剪宽高度时候直接上传原图
  type: Boolean,
  default: false,
  required: false,
},
if (reader.readyState == 2) {
  if ( !_this.sizeChange && _this.smallToUpload && img.width <= _this.cutWidth && img.height <= _this.cutHeight) {
    _this.handleClose()
    _this.$emit('cutDown', {
        filename: file.name,
        file: file,
    })
    return;
  }
  _this.putToolBox(); // 挪进来或许更好一些
  //......
}

顺便说个别的事情,确认按钮的事件建议加上执行括号来做兼容

<span @click="cropPicture">
<!-- 更换为 -->
<span @click="cropPicture()">

该方法会因为传递了$event做第一个参数判断时隐形转为true从而不触发cutDown事件

cropPicture: function (doNotReset) {
}

2.1.6版本基本裁剪功能失效

bug描述
组件选择图片以后,点击确认按钮,无任何效果:
仔细查看源代码以后,您采用“doNotReset”字段作为判断是cutDown还是onPrintImg事件,但是这个字段在确定按钮代码部分未传值。导致产生bug。

 <span @click="cropPicture">
         <slot name="confirm">
             <button type="button" class="btn btn-primary" style="margin-left:15px;" :disabled="!drawImg.img">确定 </button>
          </slot
</span>

版本号
2.1.6
浏览器版本
IE/Edge/Firefox/Chrome

水印文字去不掉,设置为空也不行

bug描述
详细描述bug是在什么操作下出现的,最好带上截图,如果可以线上预览,请附上链接
版本号
此bug出现在哪个版本
浏览器版本
IE/Edge/Firefox/Chrome

裁剪选择框位置

bug描述
不是bug,我想问下 我想记录用户最后拖动裁剪框的位置,下次裁剪会记录下来,但是我总找不到x 和 y的公用值,要么就是裁剪框位置变化了 但是截取的图像位置没有变化
版本号
此bug出现在哪个版本
最新版本

弹窗模式下选择图片按钮隐藏不了

bug描述
详细描述bug是在什么操作下出现的,最好带上截图,如果可以线上预览,请附上链接
版本号
此bug出现�弹窗模式下选择图片按钮隐藏不了在哪个版本
浏览器版本
IE/Edge/Firefox/Chrome

初始化项目报loaders错误

bug描述
项目初始化的时候,运行起来报调用组件的loader问题

ERROR in ./node_modules/vue-img-cutter/src/components/ImgCutter.vue 1:0
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

|


| <div @click="handleOpen" v-if="showChooseBtn === true && isModal === true">

版本号
3.0.0
浏览器版本
Chrome

兼容IE9

你好,我想问一下这个兼容IE9嘛?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.