<template>
  <view>
    <view v-for="item in data.sonTask" :key="item.detailId">
      <span class="text-xs text-gray-500">{{ item.name }}</span>
    </view>
  </view>
</template>

<script setup>
import { reactive, defineProps } from 'vue';

const props = defineProps({
  task: {
    type: Object,
    default: () => {},
  },
});
const data = reactive({ sonTask: [] });

async function getSonTask() {
  try {
    const res = await uni.$u.api.findSonTask({ detailId: props.task.detailId });
    data.sonTask = res;
  } catch (error) {
    console.error('p-subtasks.vue getSonTask error: ', error);
  }
}
getSonTask();
</script>

<style></style>
