From 15ff2af69bb77dd0b01209ebab77aad1bce6cb43 Mon Sep 17 00:00:00 2001 From: ZhangXianQiang <1135831638@qq.com> Date: 星期一, 01 七月 2024 15:07:40 +0800 Subject: [PATCH] feat:填空题填写 --- src/views/exam/components/answer-sheet/index.vue | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/views/exam/components/answer-sheet/index.vue b/src/views/exam/components/answer-sheet/index.vue index 2199d32..bb9bc94 100644 --- a/src/views/exam/components/answer-sheet/index.vue +++ b/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> -- Gitblit v1.8.0