Fixed #5070 - Message: 'life-end' emit
parent
9a27f6b16b
commit
1a1b60c443
|
@ -75,6 +75,10 @@ const MessageEvents = [
|
|||
description: 'Browser event'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'life-end',
|
||||
description: "Callback to invoke when the message's timeout is over."
|
||||
}
|
||||
];
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue