vue-izitoast
vue-izitoast copied to clipboard
How to close a single toast, as well as all of them?
As the title says, how can I close a specific toast or all of them if I need?
I've tried this.$toast.remove(); this.$toast.hide(); I've tried searching inside the izi-toast.js for the function but there doesn't seem to be one
Using the main library as reference: http://izitoast.marcelodolza.com/#Methods
To destroy all you use:
iziToast.destroy();
I tried:
this.$toast.destroy();
worked
To hide an specific toast you must reference it with a class and use:
var toast = document.querySelector('.iziToast'); // Selector of your toast
iziToast.hide({}, toast);
// Or make new settings
iziToast.hide({
transitionOut: 'fadeOutUp'
}, toast);
could not make work
Hi, @eiipaw I investigate on this and maybe if necessary I can implement a hideAll method.