swiper.vue 1.43 KB
<template>
  <div class="swiper">
    <div class="swiper-item swiper-item-left">
      <a :href="list[0].url">
        <ImageFormat @click="clickHandler(item, index)" :lazy="false" class="item-imge" :src="list[0].src" :width="302" :height="402"></ImageFormat>
      </a>
    </div>
    <div class="swiper-item swiper-item-right">
      <a :href="list[1].url">
        <ImageFormat @click="clickHandler(item, index)" :lazy="false" class="item-imge" :src="list[1].src" :width="374" :height="196"></ImageFormat>
      </a>
      <a :href="list[2].url">
        <ImageFormat style="margin-top: 4px" @click="clickHandler(item, index)" :lazy="false" class="item-imge" :src="list[2].src" :width="374" :height="196"></ImageFormat>
      </a>
    </div>
  </div>
</template>

<script>
export default {
  name: 'swiper',
  props: {
    list: {
      type: Array,
      default: true,
    },
  },
  methods: {
    jump(item) {
      const { src, url } = item;
      console.log(src);
      console.log(url);
    }
  }
};
</script>

<style lang="scss" scoped>
.swiper {
  // margin-top: -250px;
  padding: 0 32px;
  overflow: hidden;
  .swiper-item {
    &.swiper-item-left {
      width: 301px;
      float: left;
      img {
        height: 402px;
      }
    }
    &.swiper-item-right {
      width: 374px;
      float: right;
      img {
        height: 196px;
      }
    }
    img {
      width: 100%;
      display: block;
      border-radius: 4px;
    }
  }
}
</style>