mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[new feature] ActionSheet: add open、close events (#3639)
This commit is contained in:
parent
c4512dbc26
commit
c6f8fca41f
@ -112,6 +112,10 @@ export default {
|
||||
| select | Triggered when click option | item, index |
|
||||
| cancel | Triggered when cancel click | - |
|
||||
| click-overlay | Triggered when click overlay | - |
|
||||
| open | Triggered when open ActionSheet | - |
|
||||
| opened | Triggered when opened ActionSheet | - |
|
||||
| close | Triggered when close ActionSheet | - |
|
||||
| closed | Triggered when closed ActionSheet | - |
|
||||
|
||||
### Data struct of actions
|
||||
|
||||
|
@ -38,14 +38,6 @@ function ActionSheet(
|
||||
) {
|
||||
const { title, cancelText } = props;
|
||||
|
||||
function onInput(value: boolean) {
|
||||
emit(ctx, 'input', value);
|
||||
}
|
||||
|
||||
function onClickOverlay() {
|
||||
emit(ctx, 'click-overlay');
|
||||
}
|
||||
|
||||
function onCancel() {
|
||||
emit(ctx, 'input', false);
|
||||
emit(ctx, 'cancel');
|
||||
@ -131,9 +123,7 @@ function ActionSheet(
|
||||
lockScroll={props.lockScroll}
|
||||
getContainer={props.getContainer}
|
||||
closeOnClickOverlay={props.closeOnClickOverlay}
|
||||
onInput={onInput}
|
||||
onClick-overlay={onClickOverlay}
|
||||
{...inherit(ctx)}
|
||||
{...inherit(ctx, true)}
|
||||
>
|
||||
{Header()}
|
||||
{props.actions.map(Option)}
|
||||
|
@ -119,6 +119,10 @@ export default {
|
||||
| select | 选中选项时触发,禁用或加载状态下不会触发 | item: 选项对应的对象, index: 选择对应的索引 |
|
||||
| cancel | 取消按钮点击时触发 | - |
|
||||
| click-overlay | 点击遮罩层时触发 | - |
|
||||
| open | 打开菜单时触发 | - |
|
||||
| opened | 打开菜单且动画结束后触发 | - |
|
||||
| close | 关闭菜单时触发 | - |
|
||||
| closed | 关闭菜单且动画结束后触发 | - |
|
||||
|
||||
### actions
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user