Skip to content

The CheckboxGroup slot not work if option[label] !== undefined #6641

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

Closed
1 task done
waldonUB opened this issue Jun 8, 2023 · 2 comments
Closed
1 task done

The CheckboxGroup slot not work if option[label] !== undefined #6641

waldonUB opened this issue Jun 8, 2023 · 2 comments

Comments

@waldonUB
Copy link
Contributor

waldonUB commented Jun 8, 2023

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.2.20

Environment

navigator.platform: Win10; navigator.appName: 5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.57; vue: 3.2.0

Reproduction link

Edit on CodeSandbox

Steps to reproduce

  • First, I have this set of data.
const options = [
{ label: 'Apple', value: 'Apple' },
{ label: 'Pear', value: 'Pear' },
{ label: 'Orange', value: 'Orange' },
];
  • Second, I want use a label slot
<a-checkbox-group v-model:value="value4" :options="options" disabled>
<template #label="{ label }">
<span style="color: red">{{ label }}</span>
</template>
</a-checkbox-group>

You'll see that the code above doesn't work because:

image.png

What is expected?

Sometimes, I want to change the label style or do special treatment of label text. I need the options[label] in the slot.

What is actually happening?

label slot not work if options[label] !== undefined


I think this component shouldn't mix slot and options attribute.If the user uses a slot, you should let him use anything, including the label.
This is my pr:

@github-actions
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants