bugfix on message

This commit is contained in:
Lawrence Lee 2017-04-13 18:40:03 +08:00
parent 55b608a6b8
commit 17628aab7b
2 changed files with 7 additions and 2 deletions

View file

@ -29,7 +29,10 @@ Notification.newInstance = properties => {
}, },
component: notification, component: notification,
destroy () { destroy () {
document.body.removeChild(document.getElementsByClassName('ivu-message')[0].parentElement); notification.closeAll();
setTimeout(function() {
document.body.removeChild(document.getElementsByClassName('ivu-message')[0].parentElement);
}, 500);
} }
}; };
}; };

View file

@ -81,13 +81,15 @@
}, },
close (name) { close (name) {
const notices = this.notices; const notices = this.notices;
for (let i = 0; i < notices.length; i++) { for (let i = 0; i < notices.length; i++) {
if (notices[i].name === name) { if (notices[i].name === name) {
this.notices.splice(i, 1); this.notices.splice(i, 1);
break; break;
} }
} }
},
closeAll () {
this.notices = [];
} }
} }
}; };