bugfix on .destroy

This commit is contained in:
Lawrence Lee 2017-04-13 17:11:31 +08:00
parent e3e81f682d
commit 55b608a6b8
2 changed files with 5 additions and 1 deletions

View file

@ -3,6 +3,7 @@
<i-button @click.native="success">显示成功提示</i-button> <i-button @click.native="success">显示成功提示</i-button>
<i-button @click.native="warning">显示警告提示</i-button> <i-button @click.native="warning">显示警告提示</i-button>
<i-button @click.native="error">显示错误提示</i-button> <i-button @click.native="error">显示错误提示</i-button>
<i-button @click.native="destroy">销毁提示</i-button>
</div> </div>
</template> </template>
<script> <script>
@ -16,6 +17,9 @@
}, },
error () { error () {
this.$Message.error('对方不想说话,并且向你抛出了一个异常'); this.$Message.error('对方不想说话,并且向你抛出了一个异常');
},
destroy () {
this.$Message.destroy();
} }
} }
} }

View file

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