<template>
  <view class="px-30 pb-30">
    <view class="sibling-border-top px-20 py-30" v-for="(item, index) in dataList" :key="index">
      <exam-record-item :data="item" />
    </view>
  </view>
</template>
<script lang="ts" setup>
import { getSimulatedRecord } from '@/api/modules/study';
import { EnumExamRecordType } from '@/common/enum';
import examRecordItem from '@/pagesStudy/components/exam-record-item.vue';
import { Study } from '@/types';
const props = defineProps({
  examType: {
    type: String,
    default: 'test'
  }
});
const dataList = ref<Study.SimulatedRecord[]>([]);
const loadData = async (type: string) => {
  dataList.value = [];
  if (type === EnumExamRecordType.SIMULATED) {
    const { data } = await getSimulatedRecord();
    dataList.value = data;
  } else {


  }

}

watch(() => props.examType, (newVal) => {
  loadData(newVal);
}, {
  immediate: false
});
onShow(() => {
  loadData(props.examType);
});
</script>
<style lang="scss" scoped></style>