Commit 55b608a6b8afc8422f70f0081138611898e0783b
1 parent
e3e81f68
bugfix on .destroy
Showing
2 changed files
with
5 additions
and
1 deletions
Show diff stats
examples/routers/message.vue
@@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
3 | <i-button @click.native="success">显示成功提示</i-button> | 3 | <i-button @click.native="success">显示成功提示</i-button> |
4 | <i-button @click.native="warning">显示警告提示</i-button> | 4 | <i-button @click.native="warning">显示警告提示</i-button> |
5 | <i-button @click.native="error">显示错误提示</i-button> | 5 | <i-button @click.native="error">显示错误提示</i-button> |
6 | + <i-button @click.native="destroy">销毁提示</i-button> | ||
6 | </div> | 7 | </div> |
7 | </template> | 8 | </template> |
8 | <script> | 9 | <script> |
@@ -16,6 +17,9 @@ | @@ -16,6 +17,9 @@ | ||
16 | }, | 17 | }, |
17 | error () { | 18 | error () { |
18 | this.$Message.error('对方不想说话,并且向你抛出了一个异常'); | 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 => { | @@ -29,7 +29,7 @@ Notification.newInstance = properties => { | ||
29 | }, | 29 | }, |
30 | component: notification, | 30 | component: notification, |
31 | destroy () { | 31 | destroy () { |
32 | - document.body.removeChild(div); | 32 | + document.body.removeChild(document.getElementsByClassName('ivu-message')[0].parentElement); |
33 | } | 33 | } |
34 | }; | 34 | }; |
35 | }; | 35 | }; |