<template>
    <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
        <card01 v-for="item in list" :key="item" :title="item + ''" icon="notes" :description="item + ''" />
    </van-list>
</template>
<script setup>
import { ref, defineProps } from 'vue';
import card01 from './card01.vue';
import { getCurrGroup } from '@/api/inspect.js';

const props = defineProps({
    type: {
        type: String,
    },
})


const list = ref([]);
const loading = ref(false);
const finished = ref(false);

const onLoad = () => {
    getCurrGroup(props.type).then(res => {
        list.value = res.data;
        loading.value = false;
        finished.value = true;
    })
};
</script>