
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
iview-upload
Advanced tools
基于 iview 进行二次开发的图片上传组件,支持上传后本地图片回显、私密图片回显不显示具体图片、上传前压缩、集成 viewjs 全屏预览插件(注:使用前先引入 iview,否则无法使用)
npm install iview-upload --save
import uploadCustom from "iview-upload";
在引入的 vue 模块中需要在 components 上注册这个组件,这样才可以正常使用这个组件:
export default {
name: 'app',
components:{
uploadCustom
},
data () {
return {
...
}
},
...
}
<upload-custom v-model="val"></upload-custom>
| 属性 | 说明 | 类型 | 默认 | 版本 |
|---|---|---|---|---|
| action 上传的地址,必填 | String | 空 | 1.0.0 | |
| headers | 设置上传的请求头部 | Object | - | 1.0.0 |
| fileData | 初始图片数据 | String | 空 | 1.0.0 |
| params | 上传时附带的额外参数 | Object | - | 1.0.0 |
| readonly | 是否只读 | Object | false | 1.0.0 |
| noShow | 隐私图片不展示具体 | Object | false | 1.0.0 |
| maxSize | 文件大小限制,单位 byte | Number | 2 _ 1024 _ 1024 | 1.0.0 |
| format | 支持的文件类型,识别文件的后缀名 | Array | [] | |
| autoCompress | 支持上传前自动压缩 | Boolean | false | |
| maxWidth | 图片最大宽度,超过则压缩,autoCompress 为 true 时生效 | Number | 2000 | |
| maxHeight | 图片最大高度,超过则压缩,autoCompress 为 true 时生效 | Number | 2000 |
| 方法 | 说明 | 返回值 |
|---|---|---|
| on-success | 上传成功 | response, file |
| on-remove | 文件移除 | |
| on-progress | 文件上传时返回 | file |
FAQs
基于iview的文件上传组件
We found that iview-upload demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.