瀏覽代碼

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

yusheng 8 月之前
父節點
當前提交
93b42015b2
共有 1 個文件被更改,包括 4 次插入0 次删除
  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%;
   }
 }