wenhongquan 1 year ago
parent
commit
e855849f87
1 changed files with 6 additions and 5 deletions
  1. 6 5
      src/components/FileUpload/index.vue

+ 6 - 5
src/components/FileUpload/index.vue

@@ -9,11 +9,11 @@
       :on-error="handleUploadError"
       :on-exceed="handleExceed"
       :on-success="handleUploadSuccess"
-      :show-file-list="false"
+      :show-file-list="true"
       :headers="headers"
       class="upload-file-uploader"
       ref="fileUploadRef"
-      auto-upload
+      :auto-upload="true"
       :drag="suportdrag"
     >
       <slot v-if="!defaultbtn"></slot>
@@ -21,7 +21,7 @@
       <el-button v-if="defaultbtn" type="primary">选取文件</el-button>
     </el-upload>
     <!-- 上传提示 -->
-    <div class="el-upload__tip" v-if="showTip" style="position: relative;">
+    <div class="el-upload__tip" v-if="showTip" style="position: relative;margin-top: 20px">
       请上传
       <template v-if="fileSize">
         <b style="color: #f56c6c">{{limit}}个以内</b>的文件单个文件大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
@@ -41,7 +41,7 @@
       class="upload-file-list el-upload-list el-upload-list--text"
       name="el-fade-in-linear"
       tag="ul"
-      style="max-height: 150px;overflow-y: auto;"
+      style="max-height: 150px;overflow-y: auto;display: none"
     >
       <li :key="file.uid" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
         <el-link :href="`${file.url}`" :underline="false" target="_blank">
@@ -136,7 +136,7 @@ const handleBeforeUpload = (file: any) => {
             return false;
         }
     }
-    proxy?.$modal.loading("正在上传文件,请稍候...");
+    // proxy?.$modal.loading("正在上传文件,请稍候...");
     number.value++;
     return true;
 }
@@ -230,4 +230,5 @@ const listToString = (list: any[], separator?: string) => {
 .ele-upload-list__item-content-action .el-link {
     margin-right: 10px;
 }
+
 </style>