Topic: Run method after toast closes
digitalmanagerguru
pro asked 3 months ago
Hi there,
is it possible to run a method after the toast closes?
I've a toast with a timer of 2000ms and after that he vanishes. In that moment I wanted to run a method. I could ofcourse create a setTimout right after I call the toast to run the method, but would be better if we could run a method after the toast ends. Maybe having a callback or something.
best regards
Open
- User: Pro
- Premium support: No
- Technology: Vue
- MDB Version: 6.7.2
- Device: Desktop
- Browser: Chrome
- OS: Win.10
- Provided sample code: No
- Provided link: No
Mikołaj Smoleński staff commented 3 months ago
There is an
afterLeaveevent which emits after the alert ends. Here's an example:<mdb-alert @afterLeave={()=> alert('afterLeave event')}>Best regards
digitalmanagerguru pro commented 3 months ago
Thanks for reply but, I'm using toasts aka notifications. Not alerts.https://mdbootstrap.com/docs/vue/advanced/notifications/
Mikołaj Smoleński staff commented 3 months ago
Unfortunately there are no events similar to alerts in notification. We're going to add such in the new MDB5 Vue wich is going to be released soon. Best regards