<template>
    <section>
        <van-swipe class="my-swipe" :autoplay="4000" indicator-color="#F96825EB">
            <van-swipe-item v-for="item in list">
                <div class="h-40 px-3 pt-3 pb-2 ">
                    <img :src="item.link" alt="" class="h-[140px] w-full rounded-lg">
                </div>
            </van-swipe-item>
        </van-swipe>
    </section>
</template>

<script setup lang="ts">
import { listCarouse } from '@/api/home';
import { onMounted, ref } from 'vue';
const list = ref([]);
const emits = defineEmits(['updateCarouseList'])
onMounted(async () => {
    const res = await listCarouse();
    list.value = res.filter(element => {
        return element.type === 1
    });
    emits('updateCarouseList', res)
});
</script>