<script setup lang="ts">
import FileUpload from '@/views/Design/components/Questions/FileUpload.vue';
const questionIndex = defineModel<number>('questionIndex', { default: NaN });
const answerIndex = computed(() => question.value.title);
const question = defineModel<question>('question', { default: () => {} });
// import { answer } from '@/views/Design/components/Questions/hooks/useFileUploadHooks';
import { computed, watch } from 'vue';

const emit = defineEmits(['changeAnswer']);
// watch(answer, () => {
//   // 暂时先将答案挂到 question,后续需要优化
//   question.value.answer = answer.value;
//   console.log(question.value.answer);
//   // emit('changeAnswer', answer.value);
//   // console.log(`question`, question.value);
// });
</script>
<template>
  <!-- 文件上传题 -->
  <file-upload
    :element="question"
    :isPreview="true"
    :index="answerIndex ?? questionIndex"
    :errorMessage="question.error"
    :active="false"
  />
</template>

<style scoped></style>
