Ver código fonte

图片自适应

zhulizhen1111 4 anos atrás
pai
commit
03b9f4114f

+ 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>