Kaynağa Gözat

轮播图样式更新

guhongwei 5 yıl önce
ebeveyn
işleme
0d98843e37
2 değiştirilmiş dosya ile 9 ekleme ve 4 silme
  1. 1 1
      src/layout/index/friendLink.vue
  2. 8 3
      src/layout/index/lunbo.vue

+ 1 - 1
src/layout/index/friendLink.vue

@@ -14,7 +14,7 @@
           <ul class="link-list">
             <li class="link-item" v-for="(item, index) in linkImgList" :key="index">
               <a :href="item.url" class="link" :title="item.title" target="_blank" rel="nofollow">
-                <img :src="item.pic" alt="" style="width:100%;heigth:100%"/>
+                <img :src="item.pic" alt="" style="width:100%;heigth:100%" />
               </a>
             </li>
           </ul>

+ 8 - 3
src/layout/index/lunbo.vue

@@ -8,7 +8,7 @@
         <el-col :span="24">
           <el-carousel height="270px" direction="vertical" :autoplay="true">
             <el-carousel-item v-for="(item, index) in lunboList" :key="index" @click.native="toOpen(item.url)">
-              <img :src="item.pic" class="imgList" />
+              <img :src="item.pic" class="img" />
             </el-carousel-item>
           </el-carousel>
         </el-col>
@@ -29,8 +29,8 @@ export default {
   computed: {},
   methods: {
     toOpen(url) {
-      if(url.includes('http')) window.open(url);
-      else window.open(`http://${url}`)
+      if (url.includes('http')) window.open(url);
+      else window.open(`http://${url}`);
     },
   },
 };
@@ -49,4 +49,9 @@ export default {
   border-bottom: 1px solid #850000;
   padding: 0 5px;
 }
+.img {
+  max-width: 100%;
+  max-height: 100%;
+  vertical-align: middle;
+}
 </style>