Browse Source

fix: actioonsheet demo , #281

richard1015 5 years ago
parent
commit
42360532e0
2 changed files with 10 additions and 2 deletions
  1. 10 1
      src/packages/actionsheet/actionsheet.vue
  2. 0 1
      src/packages/actionsheet/demo.vue

+ 10 - 1
src/packages/actionsheet/actionsheet.vue

@@ -82,12 +82,21 @@ export default {
         if (value) {
           document.body.classList.add('nut-overflow-hidden');
         } else {
-          document.body.classList.remove('nut-overflow-hidden');
+          this.remolveLockScrool();
         }
       }
     }
   },
+  deactivated() {
+    this.remolveLockScroll();
+  },
+  destroyed(){
+    this.remolveLockScroll();
+  },
   methods: {
+    remolveLockScroll(){
+      document.body.classList.remove('nut-overflow-hidden');
+    },
     isHighlight(item) {
       return (this.chooseTagValue && this.chooseTagValue == item[this.optionTag]) || this.chooseTagValue === 0;
     },

+ 0 - 1
src/packages/actionsheet/demo.vue

@@ -77,7 +77,6 @@
     <nut-actionsheet :is-visible="isVisible5" @close="switchActionSheet('isVisible5')">
       <div slot="custom" class="custom-wrap"><span>自定义</span></div>
     </nut-actionsheet>
-    <div style="height: 400px"></div>
   </div>
 </template>