浏览代码

fix: actioonsheet demo , #281

richard1015 5 年之前
父节点
当前提交
42360532e0
共有 2 个文件被更改,包括 10 次插入2 次删除
  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>