Commit 55b608a6b8afc8422f70f0081138611898e0783b

Authored by Lawrence Lee
1 parent e3e81f68

bugfix on .destroy

examples/routers/message.vue
... ... @@ -3,6 +3,7 @@
3 3 <i-button @click.native="success">显示成功提示</i-button>
4 4 <i-button @click.native="warning">显示警告提示</i-button>
5 5 <i-button @click.native="error">显示错误提示</i-button>
  6 + <i-button @click.native="destroy">销毁提示</i-button>
6 7 </div>
7 8 </template>
8 9 <script>
... ... @@ -16,6 +17,9 @@
16 17 },
17 18 error () {
18 19 this.$Message.error('对方不想说话,并且向你抛出了一个异常');
  20 + },
  21 + destroy () {
  22 + this.$Message.destroy();
19 23 }
20 24 }
21 25 }
... ...
src/components/base/notification/index.js
... ... @@ -29,7 +29,7 @@ Notification.newInstance = properties =&gt; {
29 29 },
30 30 component: notification,
31 31 destroy () {
32   - document.body.removeChild(div);
  32 + document.body.removeChild(document.getElementsByClassName('ivu-message')[0].parentElement);
33 33 }
34 34 };
35 35 };
... ...