list01.vue 721 B

1234567891011121314151617181920212223242526272829
  1. <template>
  2. <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
  3. <card01 v-for="item in list" :key="item" :title="item + ''" icon="notes" :description="item + ''" />
  4. </van-list>
  5. </template>
  6. <script setup>
  7. import { ref, defineProps } from 'vue';
  8. import card01 from './card01.vue';
  9. import { getCurrGroup } from '@/api/inspect.js';
  10. const props = defineProps({
  11. type: {
  12. type: String,
  13. },
  14. })
  15. const list = ref([]);
  16. const loading = ref(false);
  17. const finished = ref(false);
  18. const onLoad = () => {
  19. getCurrGroup(props.type).then(res => {
  20. list.value = res.data;
  21. loading.value = false;
  22. finished.value = true;
  23. })
  24. };
  25. </script>