loki 3 лет назад
Родитель
Сommit
8744833f10
1 измененных файлов с 4 добавлено и 3 удалено
  1. 4 3
      src/components/Upload.vue

+ 4 - 3
src/components/Upload.vue

@@ -52,7 +52,8 @@
         </template> -->
 
     <template v-if="limit">
-      最多上传 <b style="color: #f56c6c">{{ limit }}</b>张
+      最多上传 <b style="color: #f56c6c">{{ limit }}</b
+      >张
     </template>
 
     <el-dialog :visible.sync="dialogVisible" :modal="false">
@@ -186,7 +187,7 @@ export default {
     //   // this.imgList = JSON.parse(JSON.stringify(this.tmp))
     // },
     handleRemove(file, fileList) {
-      const result = this.imgList.filter(x => x.name !== file.name);
+      const result = this.imgList.filter(x => x.url !== file.url);
       this.$emit('input', result);
     },
     handlePictureCardPreview(file) {
@@ -196,7 +197,7 @@ export default {
     handleBeforeUpload(file) {
       const isLt100M = file.size / 1024 / 1024 < 5;
       if (!isLt100M) {
-        this.$message.error("上传照片大小要在5MB以内哦!");
+        this.$message.error('上传照片大小要在5MB以内哦!');
         return false;
       }
       this.loading = this.$loading({