Dialog: only destroy slot when destroyOnClose is true

pull/19753/head
guoweijian 2020-06-30 10:00:42 +08:00
parent bf534d977e
commit d23c7160f5
1 changed files with 2 additions and 6 deletions

View File

@ -9,7 +9,6 @@
@click.self="handleWrapperClick"> @click.self="handleWrapperClick">
<div <div
role="dialog" role="dialog"
:key="key"
aria-modal="true" aria-modal="true"
:aria-label="title || 'dialog'" :aria-label="title || 'dialog'"
:class="['el-dialog', { 'is-fullscreen': fullscreen, 'el-dialog--center': center }, customClass]" :class="['el-dialog', { 'is-fullscreen': fullscreen, 'el-dialog--center': center }, customClass]"
@ -112,8 +111,7 @@
data() { data() {
return { return {
closed: false, closed: false
key: 0
}; };
}, },
@ -133,9 +131,7 @@
this.$el.removeEventListener('scroll', this.updatePopper); this.$el.removeEventListener('scroll', this.updatePopper);
if (!this.closed) this.$emit('close'); if (!this.closed) this.$emit('close');
if (this.destroyOnClose) { if (this.destroyOnClose) {
this.$nextTick(() => { this.rendered = false;
this.key++;
});
} }
} }
} }