Browse Source

考试剩余时间负数处理

Michael Wang 4 years ago
parent
commit
edb63a5ef6
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/features/OnlineExam/Examing/RemainTime.vue

+ 2 - 0
src/features/OnlineExam/Examing/RemainTime.vue

@@ -65,6 +65,8 @@ export default {
       if (this.remainTime > 0) {
         this.remainTime = this.remainTime - 1000;
       }
+      // 剩余时间永远不应该为负数,否则会显示 "23:59:59"
+      if (this.remainTime < 0) this.remainTime = 0;
     }, 1000);
 
     this.__count = 10;