-
-
Notifications
You must be signed in to change notification settings - Fork 56
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(select): rendering card slots #181
Conversation
✅ Deploy Preview for anu-vue ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Hi @IcetCode Thanks for your PR. Actually, the Original issue lies in how we pass down the slots to the child & typography component. Issue with passing down slots via the current mechanismATM we are doing something like below in almost all the components due to atomic behavior of anu: <!-- ℹ️ Recursively pass down slots to child -->
<template
v-for="(_, name) in aCardTypographySlots"
#[name]="slotProps"
>
<slot
:name="name"
v-bind="slotProps"
/>
</template> However, down side of this approach is we are using the child component's slot & redefining it in the parent component. This is fine for most of the case but fails where we conditionally checks for slot usage like in Typography component. Hence, we need to filter the slots before passing them down. The quickest way is adding v-if to the loop which is against the style guide of vue: <!-- ℹ️ Recursively pass down slots to child -->
<template
v-for="(_, name) in aCardTypographySlots"
v-if="$slots[name]"
#[name]="slotProps"
>
<slot
:name="name"
v-bind="slotProps"
/>
</template> This works but following the style guide, we need some computed properties like yours. hence, I updated the PR for this. Will perform changes in the rest of the components with this new composable to avoid issues. |
BTW, I wounder how you are able test the components ATM 🤔 Tests aren't working 🤷🏻♂️ |
I removed the browser mode from vitest.config.ts, considering we are waiting for its new PR, I have not committed this change yet. |
#180