Prechádzať zdrojové kódy

fix 练习和考试组件复用造成的问题

Michael Wang 6 rokov pred
rodič
commit
8e5476444c

+ 2 - 2
src/features/OnlineExam/Examing/ExamingHome.vue

@@ -1,5 +1,5 @@
 <template>
-  <div v-if="exam && examQuestion()" class="container">
+  <div v-if="exam && examQuestion()" class="container" :key="exam.id">
     <div class="header">
       <RemainTime></RemainTime>
       <OverallProgress :exam-question-list="examQuestionList"></OverallProgress>
@@ -23,7 +23,7 @@
       <p slot="footer">
       </p>
     </Modal>
-    <FaceTracking />
+    <FaceTracking v-if="faceEnable" />
   </div>
   <div v-else>
     正在等待数据返回... <i-button class="qm-primary-button" v-if="timeouted" @click="reloadPage">重试</i-button>

+ 1 - 1
src/features/OnlineExam/Examing/FaceTracking.vue

@@ -14,7 +14,7 @@ export default {
 
     function trackHead() {
       var video = document.getElementById("video");
-      if (video.readyState === 4) {
+      if (video && video.readyState === 4) {
         trackStarted = true;
       } else {
         return;