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

element-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

element-upload

A upload component for Vue.js.

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
17
6.25%
Maintainers
1
Weekly downloads
 
Created
Source

element-upload

A element-upload component for Vue.js.

Demo

http://element-component.github.io/element-upload

Installation

npm i element-upload -D

Usage

import Vue from 'vue'
import ElUpload from 'element-upload'
import 'element-theme-chalk/dist/upload.css'

Vue.use(ElUpload)

or

import Vue from 'vue'
import ElUpload from 'element-upload'

Vue.component('el-upload', ElUpload)

Attribute

参数说明类型可选值默认值
action必选参数, 上传的地址string
headers可选参数, 设置上传的请求头部object
multiple可选参数, 是否支持多选文件boolean
data可选参数, 上传时附带的额外参数object
name可选参数, 上传的文件字段名stringfile
with-credentials支持发送 cookie 凭证信息booleanfalse
show-file-list是否显示已上传文件列表booleantrue
type上传控件类型stringselect,dragselect
accept可选参数, 接受上传的文件类型(thumbnail-mode 模式下此参数无效)string
on-preview可选参数, 点击已上传的文件链接时的钩子, 可以通过 file.response 拿到服务端返回数据function(file)
on-remove可选参数, 文件列表移除文件时的钩子function(file, fileList)
on-success可选参数, 文件上传成功时的钩子function(response, file, fileList)
on-error可选参数, 文件上传失败时的钩子function(err, response, file)
before-upload可选参数, 上传文件之前的钩子,参数为上传的文件,若返回 false 或者 Promise 则停止上传。function(file)
thumbnail-mode是否设置为图片模式,该模式下会显示图片缩略图booleanfalse
default-file-list默认已上传的文件列表, 例如: [{name: 'food.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'}]array[]

Methods

方法名说明参数
clearFiles清空已上传的文件列表

Development

make dev

## test
make test

## build
make build

License

MIT

Keywords

element

FAQs

Package last updated on 20 Dec 2017

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