Explorar o código

iview 的message 会修改 body 的style

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

+ 6 - 1
src/features/OnlineExam/Examing/ExamingHome.vue

@@ -121,7 +121,8 @@ export default {
     hideBodyScroll: {
       handler: function() {
         // 避免macos上下塘动。避免产生滚动条。
-        document.body.style.overflow = this.hideBodyScroll ? "hidden" : "";
+        // document.body.style.overflow = this.hideBodyScroll ? "hidden" : "";
+        document.body.classList.toggle("hide-body-scroll", this.hideBodyScroll);
       },
       immediate: true,
     },
@@ -785,4 +786,8 @@ export default {
   max-width: 100%;
   height: auto !important;
 }
+
+.hide-body-scroll {
+  overflow: hidden !important;
+}
 </style>