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(RadioGroup): add selected to label slot props #1587

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

simoncdn
Copy link

@simoncdn simoncdn commented Mar 30, 2024

πŸ”— Linked issue

Resolves #1563

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

The idea is to create a binding name 'selected' that returns a boolean if a radio is selected or not.
So I've created a new function named: guessOptionSelected(option: any) and passed it as a value of the key "selected" in the return of normalizeOptions function.
Then I've created a bind 'selected: option.selected' in the slot.

Code example:
Screenshot 2024-03-29 at 19 09 53
Video example:
https://github.com/nuxt/ui/assets/105924355/e6a07932-a7d7-4fbf-bcba-c415fff1beb8

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@benjamincanac benjamincanac changed the title feat(RadioGroup): Add selected binding feat(RadioGroup): add selected to label slot props Jul 23, 2024
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.

selected property in RadioGroup #label slot
2 participants