ソースを参照

fix(uploader): 修复图片拉伸样式问题 #2026

richard1015 2 年 前
コミット
06c486e436

+ 7 - 2
src/packages/__VUE/uploader/index.scss

@@ -117,6 +117,10 @@
       position: relative;
       width: $uploader-picture-width;
       height: $uploader-picture-height;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      border-radius: 6px;
       .close {
         position: absolute;
         right: 0;
@@ -141,8 +145,9 @@
         @include oneline-ellipsis();
       }
       &__c {
-        height: 100%;
-        width: 100%;
+        max-width: 100%;
+        max-height: 100%;
+        border-radius: 6px;
       }
       &__file {
         height: 100%;

+ 1 - 0
src/packages/__VUE/uploader/index.taro.vue

@@ -23,6 +23,7 @@
 
         <img
           class="nut-uploader__preview-img__c"
+          mode="aspectFit"
           @click="fileItemClick(item)"
           v-if="item.type?.includes('image') && item.url"
           :src="item.url"