mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-24 02:16:12 +08:00
feat(Dialog): add opened、closed event (#4634)
This commit is contained in:
parent
02a81a1ac3
commit
c4713ad0c2
@ -73,6 +73,14 @@ export default createComponent({
|
|||||||
if (this.callback) {
|
if (this.callback) {
|
||||||
this.callback(action);
|
this.callback(action);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onOpened() {
|
||||||
|
this.$emit('opened');
|
||||||
|
},
|
||||||
|
|
||||||
|
onClosed() {
|
||||||
|
this.$emit('closed');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -131,7 +139,11 @@ export default createComponent({
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<transition name="van-dialog-bounce">
|
<transition
|
||||||
|
name="van-dialog-bounce"
|
||||||
|
onAfterEnter={this.onOpened}
|
||||||
|
onAfterLeave={this.onClosed}
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
vShow={this.value}
|
vShow={this.value}
|
||||||
role="dialog"
|
role="dialog"
|
||||||
|
@ -163,7 +163,9 @@ export default {
|
|||||||
| confirm | Triggered when click confirm button | - |
|
| confirm | Triggered when click confirm button | - |
|
||||||
| cancel | Triggered when click cancel button | - |
|
| cancel | Triggered when click cancel button | - |
|
||||||
| open | Triggered when open Dialog | - |
|
| open | Triggered when open Dialog | - |
|
||||||
|
| opened | Triggered when opened Dialog | - |
|
||||||
| close | Triggered when close Dialog | - |
|
| close | Triggered when close Dialog | - |
|
||||||
|
| closed | Triggered when closed Dialog | - |
|
||||||
|
|
||||||
### Slots
|
### Slots
|
||||||
|
|
||||||
|
@ -196,7 +196,9 @@ export default {
|
|||||||
| confirm | 点击确认按钮时触发 | - |
|
| confirm | 点击确认按钮时触发 | - |
|
||||||
| cancel | 点击取消按钮时触发 | - |
|
| cancel | 点击取消按钮时触发 | - |
|
||||||
| open | 打开弹窗时触发 | - |
|
| open | 打开弹窗时触发 | - |
|
||||||
|
| opened | 打开弹窗且动画结束后触发 | - |
|
||||||
| close | 关闭弹窗时触发 | - |
|
| close | 关闭弹窗时触发 | - |
|
||||||
|
| closed | 关闭弹窗且动画结束后触发 | - |
|
||||||
|
|
||||||
### Slots
|
### Slots
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user