mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
feat(ActionSheet): add click-overlay event (#1993)
This commit is contained in:
parent
dffdf3bae9
commit
f8abff6185
@ -103,6 +103,7 @@ Page({
|
|||||||
| bind:select | 选中选项时触发,禁用或加载状态下不会触发 | event.detail: 选项对应的对象 |
|
| bind:select | 选中选项时触发,禁用或加载状态下不会触发 | event.detail: 选项对应的对象 |
|
||||||
| bind:close | 关闭时触发 | - |
|
| bind:close | 关闭时触发 | - |
|
||||||
| bind:cancel | 取消按钮点击时触发 | - |
|
| bind:cancel | 取消按钮点击时触发 | - |
|
||||||
|
| bind:click-overlay | 点击遮罩层时触发 | - |
|
||||||
|
|
||||||
### actions
|
### actions
|
||||||
|
|
||||||
|
@ -42,6 +42,11 @@ VantComponent({
|
|||||||
|
|
||||||
onClose() {
|
onClose() {
|
||||||
this.$emit('close');
|
this.$emit('close');
|
||||||
|
},
|
||||||
|
|
||||||
|
onClickOverlay() {
|
||||||
|
this.$emit('click-overlay');
|
||||||
|
this.onClose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
custom-class="van-action-sheet"
|
custom-class="van-action-sheet"
|
||||||
safe-area-inset-bottom="{{ safeAreaInsetBottom }}"
|
safe-area-inset-bottom="{{ safeAreaInsetBottom }}"
|
||||||
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
||||||
bind:close="onClose"
|
bind:close="onClickOverlay"
|
||||||
>
|
>
|
||||||
<view wx:if="{{ title }}" class="van-hairline--bottom van-action-sheet__header">
|
<view wx:if="{{ title }}" class="van-hairline--bottom van-action-sheet__header">
|
||||||
{{ title }}
|
{{ title }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user