mirror of https://github.com/ElemeFE/element
Merge pull request #804 from B1anker/master
Message, Notification: fix transitionend bugpull/805/head
commit
bd0ee6b270
|
@ -35,15 +35,18 @@
|
||||||
closed(newVal) {
|
closed(newVal) {
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
this.$el.addEventListener('transitionend', () => {
|
this.$el.addEventListener('transitionend', this.destroyElement);
|
||||||
this.$destroy(true);
|
|
||||||
this.$el.parentNode.removeChild(this.$el);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
destroyElement() {
|
||||||
|
this.$el.removeEventListener('transitionend', this.destroyElement);
|
||||||
|
this.$destroy(true);
|
||||||
|
this.$el.parentNode.removeChild(this.$el);
|
||||||
|
},
|
||||||
|
|
||||||
handleClose() {
|
handleClose() {
|
||||||
this.closed = true;
|
this.closed = true;
|
||||||
if (typeof this.onClose === 'function') {
|
if (typeof this.onClose === 'function') {
|
||||||
|
@ -70,4 +73,4 @@
|
||||||
this.startTimer();
|
this.startTimer();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -44,15 +44,18 @@
|
||||||
closed(newVal) {
|
closed(newVal) {
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
this.$el.addEventListener('transitionend', () => {
|
this.$el.addEventListener('transitionend', this.destroyElement);
|
||||||
this.$destroy(true);
|
|
||||||
this.$el.parentNode.removeChild(this.$el);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
destroyElement() {
|
||||||
|
this.$el.removeEventListener('transitionend', this.destroyElement);
|
||||||
|
this.$destroy(true);
|
||||||
|
this.$el.parentNode.removeChild(this.$el);
|
||||||
|
},
|
||||||
|
|
||||||
handleClose() {
|
handleClose() {
|
||||||
this.closed = true;
|
this.closed = true;
|
||||||
if (typeof this.onClose === 'function') {
|
if (typeof this.onClose === 'function') {
|
||||||
|
@ -85,4 +88,4 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue