0.0.1 • Published 1 year ago

chengla-web-ui-test-1 v0.0.1

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

uploadFileCl uploadFileOSS

提示

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

安装

npm install chengla-web-ui

参数描述

imgWidth:      type: number|string // 图片的宽 必须和高同时出现
imgHeight:     type: number|string // 图片的高
sliceRange:    type: number, // 切片大小 MB
multiple:      type: Boolean, // 是否多选  默认为false
type:          type: String, // 上传类型 img, text, video 默认为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
uploadHost:    type: String, // 上传域名

使用

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

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