ZhangXianQiang
2024-07-05 98f494cf633e3acf5c20f3e9de0d708f2a6c2045
src/views/exam/components/answer-sheet/index.vue
@@ -22,13 +22,13 @@
import {useExamStore} from '@/store/index.js';
const examStore = useExamStore();
const {examType, examDetail,currentType,currentIndex} = storeToRefs(examStore);
const {examDetail,currentType,currentIndex} = storeToRefs(examStore);
const activeNames = ref(examDetail.value.map(item => item.questionType));
const itemClass = (question,type,index) => {
  return {
    answer: question.answer || (question.answerList && question.answerList.length),
    answer: question.answer || checkAnswerList(question.answerList),
    active: currentType.value === type && currentIndex.value === index
  }
}
@@ -38,6 +38,11 @@
  currentIndex.value = index;
}
const checkAnswerList = (answerList) => {
  return Array.isArray(answerList) && answerList.length && answerList.every(item => item);
}
</script>
<style lang="scss" scoped>