mirror of https://github.com/ElemeFE/element
Dialog: only destroy slot when destroyOnClose is true
parent
bf534d977e
commit
d23c7160f5
|
@ -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++;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue