Merge pull request #804 from B1anker/master

Message, Notification: fix transitionend bug
pull/805/head
杨奕 2016-11-03 16:20:51 +08:00 committed by GitHub
commit bd0ee6b270
2 changed files with 16 additions and 10 deletions

View File

@ -35,15 +35,18 @@
closed(newVal) {
if (newVal) {
this.visible = false;
this.$el.addEventListener('transitionend', () => {
this.$destroy(true);
this.$el.parentNode.removeChild(this.$el);
});
this.$el.addEventListener('transitionend', this.destroyElement);
}
}
},
methods: {
destroyElement() {
this.$el.removeEventListener('transitionend', this.destroyElement);
this.$destroy(true);
this.$el.parentNode.removeChild(this.$el);
},
handleClose() {
this.closed = true;
if (typeof this.onClose === 'function') {

View File

@ -44,15 +44,18 @@
closed(newVal) {
if (newVal) {
this.visible = false;
this.$el.addEventListener('transitionend', () => {
this.$destroy(true);
this.$el.parentNode.removeChild(this.$el);
});
this.$el.addEventListener('transitionend', this.destroyElement);
}
}
},
methods: {
destroyElement() {
this.$el.removeEventListener('transitionend', this.destroyElement);
this.$destroy(true);
this.$el.parentNode.removeChild(this.$el);
},
handleClose() {
this.closed = true;
if (typeof this.onClose === 'function') {