Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Manually end a toast using Vue-toastification

Good day,

I am currently using Vue-toastification and I wanted to ask if it’s possible to manually end a toast notification? I have searched the docs and I couldn’t find it.

My goal is that when another toast notification pops up the 1st one should be deleted. I now have hardcoded timeouts, but the time can vary and it’s sometimes not very precise.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Here is my toast.

this.$toast.info("Please hold on a moment, your file is being downloaded.");

I have tried both toast.close() and toast.remove(), but this doesn’t yield the expected result.

Thank you for reading this!

>Solution :

use this:

const id = this.$toast.info("Please hold on a moment, your file is being downloaded.")

// dismiss
this.$toast.dismiss(id)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading