vue-toasted icon indicating copy to clipboard operation
vue-toasted copied to clipboard

How to remove specific global toast?

Open phuc2401 opened this issue 4 years ago • 3 comments

Hello everyone, I checked and see that we only support clear() to clear all toast. Do we have some option to clear specific toast? The case is I registered 2 global toast, one of them will show when we have no internet connection. So when the connection is back, I want to clear that toast, but can't find a suitable option.

phuc2401 avatar Oct 08 '20 07:10 phuc2401


let offlineToast = this.$toasted.global.my_app_error({
    message : 'You are offline!'
});

offlineToast.goAway();

this doesn't work for you ?

shakee93 avatar Oct 08 '20 08:10 shakee93

Hi @shakee93, thank you for the response, the case is I registered global Toast like this example, and we can use this.$toasted.global.my_app_error(); to show that toast. But how can I close this global toast? image

phuc2401 avatar Oct 12 '20 03:10 phuc2401

let offlineToast = this.$toasted.global.my_app_error({
    message : 'You are offline!'
});

offlineToast.goAway();

this doesn't work for you ?

you have to update it like this example. and call goAway to remove the global toast

shakee93 avatar Oct 12 '20 05:10 shakee93