|
@@ -13,12 +13,13 @@
|
|
|
:headers="headers"
|
|
|
class="upload-file-uploader"
|
|
|
ref="fileUpload"
|
|
|
+ v-if="!disabled"
|
|
|
>
|
|
|
<!-- 上传按钮 -->
|
|
|
<el-button type="primary">选取文件</el-button>
|
|
|
</el-upload>
|
|
|
<!-- 上传提示 -->
|
|
|
- <div class="el-upload__tip" v-if="showTip">
|
|
|
+ <div class="el-upload__tip" v-if="showTip && !disabled">
|
|
|
请上传
|
|
|
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
|
|
|
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
|
|
@@ -31,7 +32,7 @@
|
|
|
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
|
|
</el-link>
|
|
|
<div class="ele-upload-list__item-content-action">
|
|
|
- <el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
|
|
|
+ <el-link :underline="false" @click="handleDelete(index)" type="danger" v-if="!disabled">删除</el-link>
|
|
|
</div>
|
|
|
</li>
|
|
|
</transition-group>
|
|
@@ -62,6 +63,11 @@ const props = defineProps({
|
|
|
isShowTip: {
|
|
|
type: Boolean,
|
|
|
default: true
|
|
|
+ },
|
|
|
+ // 禁用组件(仅查看文件)
|
|
|
+ disabled: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
}
|
|
|
});
|
|
|
|