Fixed #1415 - Toast does not clear hide timeout on unmount
parent
81f2a65638
commit
0333cf1fce
|
@ -34,16 +34,22 @@ export default {
|
||||||
}, this.message.life)
|
}, this.message.life)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
beforeUnmount() {
|
||||||
|
this.clearCloseTimeout();
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
close() {
|
close() {
|
||||||
this.$emit('close', this.message);
|
this.$emit('close', this.message);
|
||||||
},
|
},
|
||||||
onCloseClick() {
|
onCloseClick() {
|
||||||
|
this.clearCloseTimeout();
|
||||||
|
this.close();
|
||||||
|
},
|
||||||
|
clearCloseTimeout() {
|
||||||
if (this.closeTimeout) {
|
if (this.closeTimeout) {
|
||||||
clearTimeout(this.closeTimeout);
|
clearTimeout(this.closeTimeout);
|
||||||
|
this.closeTimeout = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.close();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
Loading…
Reference in New Issue