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

selected property in RadioGroup #label slot #1563

Open
cco3 opened this issue Mar 25, 2024 · 1 comment · May be fixed by #1587
Open

selected property in RadioGroup #label slot #1563

cco3 opened this issue Mar 25, 2024 · 1 comment · May be fixed by #1587
Labels
enhancement New feature or request

Comments

@cco3
Copy link

cco3 commented Mar 25, 2024

Description

Right now, the docs show the following usage:

<template #label="{ option }">
  <p class="italic">
    <UIcon :name="option.icon" />
    {{ option.label }}
  </p>
</template>

In practice, it's common to need to apply some style to selected items, especially when hiding the ring. This will look something like this:

<template #label="{ option }">
  <p class="italic" :class="{ selected: selectedValue === option.value}">
    <UIcon :name="option.icon" />
    {{ option.label }}
  </p>
</template>

I'd much prefer to have a selected prop passed to the slot so I can do something like this:

<template #label="{ option, selected }">
    <p class="italic" :class="{ selected }">
    <UIcon :name="option.icon" />
    {{ option.label }}
  </p>
</template>

Additional context

No response

@cco3 cco3 added the enhancement New feature or request label Mar 25, 2024
@simoncdn
Copy link
Sponsor Contributor

Hello @cco3,
I'm working on it 🙂

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

Successfully merging a pull request may close this issue.

2 participants