cl-upload-files

0.1.15 • Public • Published

upload-file

提示

该组件默认为透明,高度和宽度充满父元素,嵌入父元素的标签内即可

安装(测试环境)

npm install cl-upload-files-test

安装(正式环境)

npm install cl-upload-files-prod

参数描述

multiple:      type: Boolean, // 是否多选  默认为false
type:          type: String, // 上传类型 img, text 默认为img        
clearInput:    type: Number, // 清除input的value 传一个数字即可 +new Date()
uploadBucket:  type: String  上传方式 cl 或者 oss 默认为cl
uploadPath     type: String, // 上传地址,根据项目区分 辅导:coaching 默认为coaching
qualitytype:   Number, // 图片压缩率 它必须是0和1之间的数字  默认为0.7

使用

<template>
  <div id="app">
    <uploadFile @fileMsg="fileMsg" uploadBucket="oss"></uploadFile>
  </div>
</template>

<script>
import uploadFile from 'cl-upload-files'
export default {
    components: { uploadFile },
    data() {
        return {
            fileList: []
        }
    },
    methods: {
        fileMsg(data) {
            console.log(data)
            if (data.code == 200) {
                this.fileList = data.info;
            } else {
                alert(data.msg)
            }
        }
    }
}
<script>

Readme

Keywords

none

Package Sidebar

Install

npm i cl-upload-files

Weekly Downloads

0

Version

0.1.15

License

none

Unpacked Size

11.4 MB

Total Files

10

Last publish

Collaborators

  • zhengping