New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

iview-upload

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iview-upload

基于iview的文件上传组件

latest
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

iview-upload

基于 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 上传的地址,必填String1.0.0
headers设置上传的请求头部Object-1.0.0
fileData初始图片数据String1.0.0
params上传时附带的额外参数Object-1.0.0
readonly是否只读Objectfalse1.0.0
noShow隐私图片不展示具体Objectfalse1.0.0
maxSize文件大小限制,单位 byteNumber2 _ 1024 _ 10241.0.0
format支持的文件类型,识别文件的后缀名Array[]
autoCompress支持上传前自动压缩Booleanfalse
maxWidth图片最大宽度,超过则压缩,autoCompress 为 true 时生效Number2000
maxHeight图片最大高度,超过则压缩,autoCompress 为 true 时生效Number2000

方法说明

方法说明返回值
on-success上传成功response, file
on-remove文件移除
on-progress文件上传时返回file


FAQs

Package last updated on 10 Mar 2021

Did you know?

Socket

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.

Install

Related posts