1.0.0 • Published 10 months ago

chengla-web-ui-test-t v1.0.0

Weekly downloads
-
License
-
Repository
-
Last release
10 months 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  上传方式 使用uploadFileCl组件时可不传
uploadPath     type: String, // 上传地址,根据项目命名 例如辅导使用coaching
qualitytype:   Number, // 图片压缩率 它必须是0和1之间的数字  默认为0.7
uploadHost:    type: String, // 上传域名
videoSizeLimit?: number; // 视频的大小限制 M
allowZip: boolean; // 支持zip上传 默认 不支持
imgLimitSize: number; // img最大上传 默认 不限制 单位M
fileLimitLength: number; // 文件最大上传数量 默认10个
videoAllowType: 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>
1.0.0

10 months ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago