Browse Source

fix(actionsheet): add new props #1395 (#1456)

Drjingfubo 3 years ago
parent
commit
b6559d48d9

+ 12 - 1
src/packages/__VUE/actionsheet/index.taro.vue

@@ -1,6 +1,13 @@
 <template>
   <view :class="classes">
-    <nut-popup pop-class="popclass" :visible="visible" position="bottom" round @click-overlay="close">
+    <nut-popup
+      pop-class="popclass"
+      :visible="visible"
+      position="bottom"
+      round
+      @click-overlay="close"
+      :closeOnClickOverlay="closeAbled"
+    >
       <view class="nut-actionsheet-panel">
         <view v-if="title" class="nut-actionsheet-title">{{ title }}</view>
         <slot></slot>
@@ -67,6 +74,10 @@ export default create({
     menuItems: {
       type: Array,
       default: () => []
+    },
+    closeAbled: {
+      type: Boolean,
+      default: true
     }
   },
   emits: ['cancel', 'choose', 'update:visible', 'close'],

+ 5 - 0
src/packages/__VUE/actionsheet/index.vue

@@ -7,6 +7,7 @@
       position="bottom"
       round
       @click-overlay="close"
+      :closeOnClickOverlay="closeAbled"
     >
       <view class="nut-actionsheet-panel">
         <view v-if="title" class="nut-actionsheet-title">{{ title }}</view>
@@ -78,6 +79,10 @@ export default create({
     isWrapTeleport: {
       type: Boolean,
       default: true
+    },
+    closeAbled: {
+      type: Boolean,
+      default: true
     }
   },
   emits: ['cancel', 'close', 'choose', 'update:visible'],