Upload上传
文件上传组件,支持拖拽及按钮点击样式,输出文件列表,适用表单上传,列表导入等场景。
基础用法
上传前请先按模版中的格式编辑内容:下载模板文件
将文件拖到此处,或 点击上传
支持 .xlsx 格式
vue
<template>
<ra-upload v-model="fileList" :accepts="[.xlsx]" @handleTempDownload="downloadTemp"></ra-upload>
</template>
<script setup>
import { ref } from "vue"
const fileList = ref([])
const downloadTemp = () => {
ElMessage.success("下载模板")
}
</script>
按钮上传
支持 .xlsx 格式
vue
<template>
<ra-upload v-model="fileList" :limit="2" :accepts="[.xlsx]" styleType="btn"></ra-upload>
</template>
默认插槽
vue
<ra-upload v-model="fileList3" :limit="2" :accepts="['.xlsx']" styleType="btn">
<el-button type="primary" :icon="Upload" circle />
</ra-upload>
属性说明
TIP
本组件基于el-upload组件开发,未设置自动继承属性,有定制需求请联系相关开发人员添加!
Upload属性:
Upload事件:
Upload插槽: