Browse Source

程序员主页的广告

ccf 3 years ago
parent
commit
b45001d193
2 changed files with 9 additions and 11 deletions
  1. 8 10
      components/ad.vue
  2. 1 1
      pages/frontend/developer/index.vue

+ 8 - 10
components/ad.vue

@@ -1,9 +1,8 @@
 <template>
 <div class="ad-container" v-if="list.length > 0">
 
-    <a class="ad-list-item" v-for="(item, index) in list" :key="index" @click="tj" :href="item.url" :style="{
-        'background-image': `url('${item.image}')`
-    }" target="view_window">
+    <a class="ad-list-item" v-for="(item, index) in list" :key="index" @click="tj" :href="item.url" target="view_window">
+      <img :src="item.image">
     </a>
 
 </div>
@@ -49,14 +48,8 @@ export default {
 }
 
 .ad-list-item {
-    margin: 16px 0;
-    display: block;
-    padding-bottom: 75%;
-    background-size: cover;
-    background-position: center;
-    background-repeat: no-repeat;
     cursor: pointer;
-
+    width: 100%;
     &:first-child {
         margin-top: 0
     }
@@ -64,6 +57,11 @@ export default {
     &:last-child {
         margin-bottom: 0;
     }
+
+    img{
+        width: 100%;
+        height: 100%;
+    }
 }
 
 .ad-tips {

+ 1 - 1
pages/frontend/developer/index.vue

@@ -459,7 +459,7 @@
             </div>
           </div>
         </section>
-        <Ad-List location="developer"></Ad-List>
+        <Ad-List location="developer_safe"></Ad-List>
         <!-- </div> -->
       </div>
     </div>