Browse Source

上传组件图片显示和清除功能优化

yusheng 8 months ago
parent
commit
93b42015b2
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/components/upload/WithView.vue

+ 4 - 0
src/components/upload/WithView.vue

@@ -57,6 +57,9 @@ export default {
       }
     },
     async clearImg() {
+      if(!this.value.id){
+          return
+      }
       await removeFile({ fileId: this.value.id });
       this.$emit('input', {});
       this.$refs.uploadRef.clearFiles();
@@ -81,6 +84,7 @@ export default {
 
   img {
     max-width: 100%;
+    max-height: 100%;
   }
 }