Commit 17628aab7b483936372b03e53542d0aceb8e9c1d

Authored by Lawrence Lee
1 parent 55b608a6

bugfix on message

src/components/base/notification/index.js
@@ -29,7 +29,10 @@ Notification.newInstance = properties => { @@ -29,7 +29,10 @@ Notification.newInstance = properties => {
29 }, 29 },
30 component: notification, 30 component: notification,
31 destroy () { 31 destroy () {
32 - document.body.removeChild(document.getElementsByClassName('ivu-message')[0].parentElement); 32 + notification.closeAll();
  33 + setTimeout(function() {
  34 + document.body.removeChild(document.getElementsByClassName('ivu-message')[0].parentElement);
  35 + }, 500);
33 } 36 }
34 }; 37 };
35 }; 38 };
src/components/base/notification/notification.vue
@@ -81,13 +81,15 @@ @@ -81,13 +81,15 @@
81 }, 81 },
82 close (name) { 82 close (name) {
83 const notices = this.notices; 83 const notices = this.notices;
84 -  
85 for (let i = 0; i < notices.length; i++) { 84 for (let i = 0; i < notices.length; i++) {
86 if (notices[i].name === name) { 85 if (notices[i].name === name) {
87 this.notices.splice(i, 1); 86 this.notices.splice(i, 1);
88 break; 87 break;
89 } 88 }
90 } 89 }
  90 + },
  91 + closeAll () {
  92 + this.notices = [];
91 } 93 }
92 } 94 }
93 }; 95 };