Gathering detailed insights and metrics for vue-img-cutter-ctw
Gathering detailed insights and metrics for vue-img-cutter-ctw
Gathering detailed insights and metrics for vue-img-cutter-ctw
Gathering detailed insights and metrics for vue-img-cutter-ctw
简单易用的vue图片裁剪插件,支持移动图像,裁剪图片,放大缩小图片,上下左右移动,固定比例,固定尺寸,远程图片裁剪,只需要很少的代码就可以实现裁剪功能,也可以通过调整参数以适应你自己的业务需求。
npm install vue-img-cutter-ctw
Typescript
Module System
Min. Node Version
Node Version
NPM Version
Vue (95.12%)
JavaScript (4.22%)
HTML (0.65%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
533 Stars
235 Commits
80 Forks
5 Watchers
4 Branches
4 Contributors
Updated on Jul 14, 2025
Latest Version
2.0.36
Package Id
vue-img-cutter-ctw@2.0.36
Unpacked Size
79.61 kB
Size
18.72 kB
File Count
5
NPM Version
6.14.4
Node Version
12.16.2
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
40
简单易用的vue图片裁剪插件,支持旋转、缩放、平移,固定比例,固定尺寸,远程图片裁剪,只需要很少的代码就可以实现裁剪功能,也可以通过调整参数以适应你自己的业务需求。
https://ihtmlcss.com/demo/dist/#/croptool
Github:https://github.com/acccccccb/vue-img-cutter
码云:https://gitee.com/GLUESTICK/vue-img-cutter
如果此项目对你有帮助,请给我一个star :)
1npm install vue-img-cutter --save-dev
1import ImgCutter from 'vue-img-cutter' 2export default { 3 components:{ 4 ImgCutter 5 }, 6... 7}
1<ImgCutter v-on:cutDown="cutDown"></ImgCutter>
1<ImgCutter v-on:cutDown="cutDown"> 2 <button slot="open">选择图片</button> 3</ImgCutter>
需要自己写一个方法来触发裁剪工具弹出 在方法中先将图片上传至服务器,拿到返回的url后创建一个obj,然后将对象传入裁剪工具
1// 传入的obj必须包含这四个属性 2let obj = { 3 name:'1.jpg',//远程图片名称 4 src:'http://url/1.jpg',//远程图片url 5 width:200,//远程图片的原始宽度 6 height:200,//远程图片的原始高度 7}
1forIe9:function(){ 2 // 此处需要先提交待裁剪的图片到服务器上,然后拿到图片name,src,width,height,这些参数必须传 3 uploadMethod(file).then((res)=>{ 4 this.$refs.imgCutterModal.handleOpen({ 5 name:res.name, 6 src:res.src, 7 width:res.width, 8 height:res.height, 9 }); 10 }); 11}
属性名 | 作用 | 类型 | 必填 | 默认值 |
---|---|---|---|---|
isModal | 是否为弹窗模式 | Boolean | 否 | true |
showChooseBtn | 是否显示选择图片按钮 | Boolean | 否 | true |
lockScroll | 是否在Dialog出现时将body滚动锁定 | Boolean | 否 | true |
label | 默认打开裁剪工具按钮的显示文字 | String | 否 | 选择图片 |
boxWidth | 裁剪工具宽度 | Number | 否 | 800 |
boxHeight | 裁剪工具高度 | Number | 否 | 400 |
cutWidth | 默认裁剪宽度 | Number | 否 | 200 |
cutHeight | 默认裁剪高度 | Number | 否 | 200 |
tool | 是否显示工具栏 | Boolean | 否 | true |
toolBgc | 工具栏背景色 | String(例: "#fff") | 否 | #fff |
sizeChange | 是否能够调整裁剪框大小 | Boolean | 否 | true |
moveAble | 能否调整裁剪区域位置 | Boolean | 否 | true |
originalGraph | 是否直接裁剪原图 | Boolean | 否 | false |
crossOrigin | 是否设置跨域,需要服务器做相应更改 | Boolean | 否 | false |
crossOriginHeader | 设置跨域信息crossOrigin为true时才生效 | String | 否 | '' |
rate | 图片比例 | String(例: "4:3") | 否 | - |
cutDown | 完成截图后要执行的方法 | Function | 是 | - |
error | 错误回调 | Function | 否 | - |
支持slot,在组件内部使用带有slot="open"属性的元素即可自定义打开组件的按钮
插槽名称 | 作用 |
---|---|
open 或 openImgCutter | 弹出裁剪框 |
choose | 选择本地图片 |
cancel | 取消/清空 |
confirm | 确认裁剪 |
属性名 | 类型 |
---|---|
fileName | 文件名 |
file | file类型的文件对象(IE部分版本可能不会返回) |
blob | blob类型的文件对象(IE部分版本可能不会返回) |
dataURL | dataURL |
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 2/29 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
45 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More