Fixed #5070 - Message: 'life-end' emit

pull/5098/head^2
tugcekucukoglu 2024-01-18 09:44:22 +03:00
parent 9a27f6b16b
commit 1a1b60c443
3 changed files with 10 additions and 1 deletions

View File

@ -75,6 +75,10 @@ const MessageEvents = [
description: 'Browser event'
}
]
},
{
name: 'life-end',
description: "Callback to invoke when the message's timeout is over."
}
];

View File

@ -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;
}
/**

View File

@ -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);
}
},