Explorar o código

fix题目内容错乱,即异步取试题后,在不改渲染的地方渲染了

Michael Wang %!s(int64=6) %!d(string=hai) anos
pai
achega
e07c976b95
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      src/features/OnlineExam/Examing/QuestionView.vue

+ 7 - 0
src/features/OnlineExam/Examing/QuestionView.vue

@@ -82,6 +82,13 @@ export default {
         this.question = null;
         return;
       }
+
+      if (currentExamQuestion.order != this.$route.params.order) {
+        console.log(
+          "试题获取内容后,发现页面已经切到别的题目上去了,放弃后续渲染"
+        );
+        return;
+      }
       const question = qContentRes.data;
 
       this.updateExamQuestion({