nandi95 / vue-toastify

🔥 Simple, extendable, dependency free notification plugin. 🔥
https://vue-toastify.netlify.com/
MIT License
227 stars 12 forks source link

@Finished event? #8

Closed xlcrr closed 4 years ago

xlcrr commented 4 years ago

Hi again,

Getting great use out of this plugin, thanks so much!

Would it be possible to add some kind of event listener that would call when the popup has disappeared or the user clicks it to remove it?

This would be useful for refreshing the screen, or loading data, after an event has completed successfully and the user has been notified of a successful event.

nandi95 commented 4 years ago

At this moment (v1.*) I can only imagine achieving this by passing a function in the status object. It only makes sense to execute the provided function on notification dismiss and finish. Not on the prompt mode and loader mode as you're already aware of them closing. It would look something like this:

this.$vToastify.error({
    body: "I'm going to refresh the page"
    callback: () => {
        window.location.reload()
    }
);
nandi95 commented 4 years ago

This has been addressed in version 1.1.0 @xlcrr