From 1a1b60c443860ac55c1384f001c633a949a25a1e Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Thu, 18 Jan 2024 09:44:22 +0300 Subject: [PATCH] Fixed #5070 - Message: 'life-end' emit --- api-generator/components/message.js | 4 ++++ components/lib/message/Message.d.ts | 4 ++++ components/lib/message/Message.vue | 3 ++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/api-generator/components/message.js b/api-generator/components/message.js index 68f553418..f78755ec8 100644 --- a/api-generator/components/message.js +++ b/api-generator/components/message.js @@ -75,6 +75,10 @@ const MessageEvents = [ description: 'Browser event' } ] + }, + { + name: 'life-end', + description: "Callback to invoke when the message's timeout is over." } ]; diff --git a/components/lib/message/Message.d.ts b/components/lib/message/Message.d.ts index 52474fdff..a4aeb713e 100755 --- a/components/lib/message/Message.d.ts +++ b/components/lib/message/Message.d.ts @@ -218,6 +218,10 @@ export interface MessageEmits { * @param {Event} event - Browser event. */ close(event: Event): void; + /** + * Callback to invoke when the message's timeout is over. + */ + 'life-end'(): void; } /** diff --git a/components/lib/message/Message.vue b/components/lib/message/Message.vue index e698a2201..9c883773d 100755 --- a/components/lib/message/Message.vue +++ b/components/lib/message/Message.vue @@ -32,7 +32,7 @@ import BaseMessage from './BaseMessage.vue'; export default { name: 'Message', extends: BaseMessage, - emits: ['close'], + emits: ['close', 'life-end'], timeout: null, data() { return { @@ -59,6 +59,7 @@ export default { closeAfterDelay() { setTimeout(() => { this.visible = false; + this.$emit('life-end'); }, this.life); } },