Skip to content

Commit b593168

Browse files
ziyoungLeopoldthecoder
authored andcommitted
Dialog: trigger closed event when closing animation ends (#11490)
* Dialog: trigger closed event when close animation ends * Update dialog.md * Update dialog.md
1 parent 0afa514 commit b593168

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

examples/docs/en-US/dialog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,3 +310,4 @@ If the variable bound to `visible` is managed in Vuex store, the `.sync` can not
310310
|---------- |-------- |---------- |
311311
| open | triggers when the Dialog opens ||
312312
| close | triggers when the Dialog closes ||
313+
| closed | triggers when the Dialog closing animation ends ||

examples/docs/es/dialog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,3 +318,4 @@ Si la variable ligada a `visible` se gestiona en el Vuex store, el `.sync` no pu
318318
| ---------------- | ---------------------------------------- | ---------- |
319319
| open | se activa cuando se abre el cuadro de Diálogo ||
320320
| close | se dispara cuando el Diálogo se cierra ||
321+
| closed | triggers when the Dialog closing animation ends ||

examples/docs/zh-CN/dialog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,5 +304,6 @@ Dialog 的内容是懒渲染的,即在第一次被打开之前,传入的默
304304
### Events
305305
| 事件名称 | 说明 | 回调参数 |
306306
|---------- |-------- |---------- |
307-
| close | Dialog 关闭的回调 ||
308307
| open | Dialog 打开的回调 ||
308+
| close | Dialog 关闭的回调 ||
309+
| closed | Dialog 关闭动画结束时的回调 ||

packages/dialog/src/component.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<template>
2-
<transition name="dialog-fade">
2+
<transition
3+
name="dialog-fade"
4+
@after-leave="afterLeave">
35
<div class="el-dialog__wrapper" v-show="visible" @click.self="handleWrapperClick">
46
<div
57
class="el-dialog"
@@ -166,6 +168,9 @@
166168
updatePopper() {
167169
this.broadcast('ElSelectDropdown', 'updatePopper');
168170
this.broadcast('ElDropdownMenu', 'updatePopper');
171+
},
172+
afterLeave() {
173+
this.$emit('closed');
169174
}
170175
},
171176

0 commit comments

Comments
 (0)