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

fix(ButtonGroup/AvatarGroup): allow v-for #173

Merged
merged 3 commits into from
May 17, 2023

Conversation

discountedcookie
Copy link
Contributor

<UButtonGroup size="md">
  <UButton
    v-for="type in ['One', 'Two', 'Three']"
    :key="type"
    :label="type"
    color="white"
  />
</UButtonGroup>

Currently this fails, since the first child of ButtonGroup will be a Fragment.

@benjamincanac benjamincanac changed the title allow v-for in ButtonGroup fix(ButtonGroup): allow v-for May 17, 2023
@benjamincanac
Copy link
Member

@ciaasteczkowy Did you manage to make this work? Just tested and it doesn't ever resolves this condition: children[0].type === Symbol.for('v-fgt').

The only way I've managed to make this work is to transform the condition to typeof children[0].type === 'symbol'.

@benjamincanac benjamincanac changed the title fix(ButtonGroup): allow v-for fix(ButtonGroup/AvatarGroup): allow v-for May 17, 2023
Copy link
Member

Just pushed to your PR, with the same fix on AvatarGroup. Let me know if this works for you!

@discountedcookie
Copy link
Contributor Author

You're right. I only made a change directly in the installed package to see if it works.

Thanks for finding another place where it can be fixed!

@benjamincanac benjamincanac merged commit 3fa10aa into nuxt:dev May 17, 2023
1 check passed
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.

None yet

2 participants