Просмотр исходного кода

搜索页器件图片处理。

yangc 8 лет назад
Родитель
Сommit
c67c751370
1 измененных файлов с 8 добавлено и 4 удалено
  1. 8 4
      components/search/GoodList.vue

+ 8 - 4
components/search/GoodList.vue

@@ -55,8 +55,8 @@
           <tbody id="productList-content">
           <tr v-for="item in good_list.components">
             <td>
-              <nuxt-link :to="`/product/component/${item.uuid}`">
-                <img width="80px" height="80px" :src="item.img?item.img:'/images/component/default.png'">
+              <nuxt-link class="component-img-box" :to="`/product/component/${item.uuid}`">
+                <img :src="item.img?item.img:item.brand.logoUrl?item.brand.logoUrl:'/images/component/default.png'">
               </nuxt-link>
             </td>
             <td class="brand-code">
@@ -399,11 +399,15 @@
     border: 1px solid #e8e8e8;
   }
 
+  .product-list tbody>tr .component-img-box {
+    width: 80px;
+    height: 80px;
+  }
   .product-list tbody>tr img {
     border: 1px solid #e8e8e8;
     margin: 10px 0 5px 0;
-    width: 80px;
-    height: 80px;
+    max-width: 80px;
+    max-height: 80px;
   }
   .product-list tbody>tr .contact{
     font-size: 14px;