From 1a20a2c7a9e1ba9a0ffb83fb3d09ee7215d260c4 Mon Sep 17 00:00:00 2001
From: ZhangXianQiang <1135831638@qq.com>
Date: 星期三, 19 六月 2024 09:55:24 +0800
Subject: [PATCH] chore(考试store):简化数据获取

---
 src/views/exam/components/answer-main/answer-single/index.vue |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/views/exam/components/answer-main/answer-single/index.vue b/src/views/exam/components/answer-main/answer-single/index.vue
index 8f9ee44..288bca2 100644
--- a/src/views/exam/components/answer-main/answer-single/index.vue
+++ b/src/views/exam/components/answer-main/answer-single/index.vue
@@ -16,19 +16,21 @@
 </template>
 
 <script setup>
-import { ref } from 'vue';
+import { ref, onMounted } from 'vue';
 import {storeToRefs} from 'pinia';
 import ExamInfo from '@/components/ExamInfo/index.vue';
 import {useExamStore} from '@/store/index.js';
 const examStore = useExamStore();
 
-const {currentType,currentIndex,activeQuestion,examDetail} = storeToRefs(examStore);
+const {currentType,currentIndex,examDetail} = storeToRefs(examStore);
+
+const activeQuestion = ref(examStore.getActiveQuestion);
 
 const answerClick = (item) => {
   if(item) {
     resetAnswer();
     item.isActive = true;
-
+    examStore.setQuestionAnswer(currentType.value, currentIndex.value, item.prefix);
   }
 };
 
@@ -42,9 +44,6 @@
   activeQuestion.value.items.forEach(item => item.isActive = false);
 }
 
-const filterExam = () => {
-  
-}
 
 </script>
 

--
Gitblit v1.8.0