diff --git a/src/components/toast/ToastMessage.vue b/src/components/toast/ToastMessage.vue index 281f3acd53..a5c25b38af 100755 --- a/src/components/toast/ToastMessage.vue +++ b/src/components/toast/ToastMessage.vue @@ -28,16 +28,22 @@ export default { }, this.message.life) } }, + beforeDestroy() { + 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: {