diff --git a/src/components/toast/ToastMessage.vue b/src/components/toast/ToastMessage.vue index 568986263..15f8acafb 100755 --- a/src/components/toast/ToastMessage.vue +++ b/src/components/toast/ToastMessage.vue @@ -34,16 +34,22 @@ export default { }, this.message.life) } }, + beforeUnmount() { + this.clearCloseTimeout(); + }, methods: { close() { this.$emit('close', this.message); }, onCloseClick() { + this.clearCloseTimeout(); + this.close(); + }, + clearCloseTimeout() { if (this.closeTimeout) { clearTimeout(this.closeTimeout); + this.closeTimeout = null; } - - this.close(); } }, computed: {