Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: multiple action support #67

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anwarulislam
Copy link

@anwarulislam anwarulislam commented May 6, 2024

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.

Copy link

vercel bot commented May 6, 2024

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

@anwarulislam
Copy link
Author

@xiaoluoboding any thought about this?

@Cannonb4ll
Copy link

This would be a very welcoming addition! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants