Browse Source

正在考试页面:body 不出现滚动条

Michael Wang 5 năm trước cách đây
mục cha
commit
23369c90e5
1 tập tin đã thay đổi với 9 bổ sung0 xóa
  1. 9 0
      src/features/OnlineExam/Examing/ExamingHome.vue

+ 9 - 0
src/features/OnlineExam/Examing/ExamingHome.vue

@@ -83,6 +83,7 @@ export default {
       showFaceId: false,
       faceEnable: false,
       timeouted: false,
+      hideBodyScroll: true,
       PRODUCTION: process.env.NODE_ENV === "production",
     };
   },
@@ -117,6 +118,13 @@ export default {
     $route: function() {
       this.examQuestion();
     },
+    hideBodyScroll: {
+      handler: function() {
+        // 避免macos上下塘动。避免产生滚动条。
+        document.body.style.overflow = this.hideBodyScroll ? "hidden" : "";
+      },
+      immediate: true,
+    },
     shouldSubmitPaper() {
       this.realSubmitPaper();
     },
@@ -371,6 +379,7 @@ export default {
       pictureAnswer: {},
     });
     this.$Modal.remove();
+    this.hideBodyScroll = false;
   },
   // beforeRouteUpdate(to, from, next) {
   //   this.updateQuestion(next);