浏览代码

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

Michael Wang 6 年之前
父节点
当前提交
e07c976b95
共有 1 个文件被更改,包括 7 次插入0 次删除
  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;
         this.question = null;
         return;
         return;
       }
       }
+
+      if (currentExamQuestion.order != this.$route.params.order) {
+        console.log(
+          "试题获取内容后,发现页面已经切到别的题目上去了,放弃后续渲染"
+        );
+        return;
+      }
       const question = qContentRes.data;
       const question = qContentRes.data;
 
 
       this.updateExamQuestion({
       this.updateExamQuestion({