<template>
  <div>
    <swiper class="swiper" circular autoplay :interval="5000">
      <swiper-item
        v-for="item in bannerList"
        :key="item.id"
        class="swiper-item"
      >
        <image :src="item.imgUrlsAfterConvert[0]" mode="aspectFill" />
      </swiper-item>
    </swiper>
  </div>
</template>

<script setup>
import { getBannerList } from '@/api/common';

const bannerList = ref([]);
async function requestBannerList() {
  const { data } = await getBannerList({ belongTab: 10 });
  bannerList.value = data.dataList;
}

onMounted(() => {
  requestBannerList();
});
</script>

<style lang="scss" scoped>
.swiper {
  height: 500rpx;
  .swiper-item {
    height: 100%;
    image {
      width: 100%;
      height: 100%;
    }
  }
}
</style>
