Commit bd0ee6b2 authored by 杨奕's avatar 杨奕 Committed by GitHub

Merge pull request #804 from B1anker/master

Message, Notification: fix transitionend bug
parents 22ba941f 13bfb39e
...@@ -35,15 +35,18 @@ ...@@ -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') {
......
...@@ -44,15 +44,18 @@ ...@@ -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') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment