vue-sonner
vue-sonner copied to clipboard
feat: multiple action support
This PR adds support for multiple actions.
Example:
toast.message('Event has been created', {
action: [
{
label: 'Cancel',
onClick: (e, toast) => toast.deleteToast(200)
},
{
label: 'Confirm',
onClick: () => console.log('Confirm')
}
],
duration: 10000000
})
Added new callback parameter in onClick function which through we can now pass the deleteToast function. And call it if it's needed. The function accepts delay as parameter to delete the toast.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| vue-sonner | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 6, 2024 10:36pm |
@xiaoluoboding any thought about this?
This would be a very welcoming addition! 🙌