Fixed #2989 - Toast: new close and life-end methods

This commit is contained in:
Tuğçe Küçükoğlu 2023-03-07 15:36:38 +03:00
parent d3e7b71b09
commit 57a490ffbd
5 changed files with 48 additions and 8 deletions

View file

@ -62,7 +62,7 @@ export default {
mounted() {
if (this.message.life) {
this.closeTimeout = setTimeout(() => {
this.close();
this.close({ message: this.message, type: 'life-end' });
}, this.message.life);
}
},
@ -70,12 +70,12 @@ export default {
this.clearCloseTimeout();
},
methods: {
close() {
this.$emit('close', this.message);
close(params) {
this.$emit('close', params);
},
onCloseClick() {
this.clearCloseTimeout();
this.close();
this.close({ message: this.message, type: 'close' });
},
clearCloseTimeout() {
if (this.closeTimeout) {