# h-upload 上传组件(王丹雷)

# 基础用法

<template>
	<div>
    <HUpload v-model="reportFile" v-bind="uploadProps"></HUpload>
	</div>
</template>
<script>
export default {
  data() {
    return {
      reportFile:"",
      uploadProps: {  // 上传配置信息
        label: '',
        key: '',
        name: "upload",
        imageValid: {
          uploadType: 'file',
          format: ['xls', 'xlsx', 'doc', 'docx', 'pdf', 'rar', 'zip'],
          size: 30,
        },
        url:"/services/openservice/open/ability/platform/ability/registration/image/upload",
        template: '文件大小限制30M以内,支持上传excel、word、pdf、rar、zip。只能上传一份报告,如有多个,请打包成一个文件上传'
      },
    }
  }
}
</script>
显示代码

# Attributes

参数 说明 类型 可选值 默认值
value / v-model 绑定值 string
imageValid 上传校验配置 object
url 上传地址 string
template 上传说明配置 string
fieldName 上传接口返回成功后用来取得返回的图片url的字段 string url
isSupportDelete 图片上传成功后是否支持删除 boolean true/false false