From 17628aab7b483936372b03e53542d0aceb8e9c1d Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Thu, 13 Apr 2017 18:40:03 +0800 Subject: [PATCH] bugfix on message --- src/components/base/notification/index.js | 5 ++++- src/components/base/notification/notification.vue | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/base/notification/index.js b/src/components/base/notification/index.js index 981c75b..7ab2c62 100644 --- a/src/components/base/notification/index.js +++ b/src/components/base/notification/index.js @@ -29,7 +29,10 @@ Notification.newInstance = properties => { }, component: notification, destroy () { - document.body.removeChild(document.getElementsByClassName('ivu-message')[0].parentElement); + notification.closeAll(); + setTimeout(function() { + document.body.removeChild(document.getElementsByClassName('ivu-message')[0].parentElement); + }, 500); } }; }; diff --git a/src/components/base/notification/notification.vue b/src/components/base/notification/notification.vue index 5409079..9695b55 100644 --- a/src/components/base/notification/notification.vue +++ b/src/components/base/notification/notification.vue @@ -81,13 +81,15 @@ }, close (name) { const notices = this.notices; - for (let i = 0; i < notices.length; i++) { if (notices[i].name === name) { this.notices.splice(i, 1); break; } } + }, + closeAll () { + this.notices = []; } } }; -- libgit2 0.21.4