vue-sonner icon indicating copy to clipboard operation
vue-sonner copied to clipboard

feat: multiple action support

Open anwarulislam opened this issue 1 year ago • 6 comments

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.

anwarulislam avatar May 06 '24 22:05 anwarulislam

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

vercel[bot] avatar May 06 '24 22:05 vercel[bot]

@xiaoluoboding any thought about this?

anwarulislam avatar May 22 '24 11:05 anwarulislam

This would be a very welcoming addition! 🙌

Cannonb4ll avatar Jun 05 '24 15:06 Cannonb4ll