更新特定情况固定比例问题
移除 node 版本和 npm 要求
编译替换为 vite4.x
vue3版本生命周期修复 unmounted
升级最新版本 vue 依赖和 vite 版本问题,解决 ts 类型引入问题
升级最新版本 vue 依赖和 vite 版本问题
提供 ts .d.ts 类型声明文件
修复 vue3 全局使用问题
修复固定角度的部分问题
修复依赖问题
vue3 版本修复部分问题
移除 node 版本和 npm 要求
添加最小截图框限制
更新 sass依赖
更新文档
修复绑定事件判断出错的问题
修复组件移除没有解绑滚动事件的问题
limitMinSize: [Number, Array, String]URL.createObjectURL 创建后没有销毁的 bug添加截图框修改触发事件
this.$emit('change-crop-size', {
width: this.cropW,
height: this.cropH
})
js
import { VueCropper } from vue-cropper
components: {
VueCropper,
}
main.js里面使用
import VueCropper from vue-cropper
Vue.use(vueCropper)
js
<script src="vuecropper.js"></script>
Vue.use(window['vue-cropper'])
exif 的依赖库, 添加 exfi-min.js 减小代码体积 45.9k => 37kbuild 升级 webpack4 升级vue install 方法
npm: Vue.use(VueCropper)web: Vue.use(window['vue-cropper'])修改坐标反馈问题
centerBox 的截图超出 1px 问题maxImgSize 为 2000maxImgSize 限制图片最大宽度和高度 默认为 2000pxinfoTrue
true 为展示真实输出图片宽高false 展示看到的截图框宽高this.$refs.cropper.getImgAxis()this.$refs.cropper.getCropAxis()highcenterboxthis.$refs.cropper.goAutoCropimgLoad 返回结果 success, errorimg max-width 样式优化canMove 是否可以移动图片 默认为是canMoveBox 是否可以移动截图框 默认为是original 是否按图片原始比例渲染 默认为否截图预览代码变更, 修改默认上传图片为 blob 预览
realTime (data) {
this.previews = data
}
<div class="show-preview" :style="{'width': previews.w + 'px', 'height': previews.h + 'px', 'overflow': 'hidden',
'margin': '5px'}">
<div :style="previews.div">
<img :src="previews.url" :style="previews.img">
</div>
</div>
this.$refs.cropper.changeScale 调用-新增固定截图框大小fiexdBox(注: 最好搭配自动生成截图框使用)
修复mac滚轮过度灵敏
this.$refs.cropper.rotateRight() // 向右边旋转 90 度
this.$refs.cropper.rotateLeft() // 向左边旋转 90 度
canScale: true
### v0.13
- 添加预览
@realTime="realTime"
```js
// Real time preview function
realTime (data) {
this.previews = data
}
<div class="show-preview" :style="{'width': previews.w + 'px', 'height': previews.h + 'px', 'overflow': 'hidden',
'margin': '5px'}">
<div :style="previews.div">
<img :src="option.img" :style="previews.img">
</div>
</div>