소스 검색

图片自适应

zhulizhen1111 4 년 전
부모
커밋
03b9f4114f
2개의 변경된 파일8개의 추가작업 그리고 3개의 파일을 삭제
  1. 4 1
      src/components/PicLarge/src/picLarge.vue
  2. 4 2
      src/components/Rotation/src/rotation.vue

+ 4 - 1
src/components/PicLarge/src/picLarge.vue

@@ -111,7 +111,10 @@ export default {
             height: 540px;
             text-align: center;
             img {
-                width: 100%;
+                max-width: 100%;
+                max-height: 100%;
+                display: block;
+                margin: auto;
             }
         }
     }

+ 4 - 2
src/components/Rotation/src/rotation.vue

@@ -40,8 +40,10 @@ export default {
         height: 100%;
     }
     img {
-        width: 100%;
-       
+        max-width: 100%;
+        max-height: 100%;
+        display: block;
+        margin: auto;  
     }
 }
 </style>