Carousel - Improve items
prop typing
#2102
Labels
bug
Something isn't working
duplicate
This issue or pull request already exists
v3
#1289
wontfix-v2
This will not be fixed in `v2.x`.
Environment
Version
v2.18.4
Reproduction
https://stackblitz.com/edit/nuxt-ui-efufxa?file=app.vue
Description
Currently, the
items
prop in the carousel component is typed asany
:The issue with typing
items
asany
is that when usingv-slot="{ item }"
, theitem
will always be typed asany
. This can make for a poor developer experience, especially when working with more complex item structures, such as creating a carousel of offer cards.I believe we can improve this by utilizing Vue's generics:
We could define the generic in the script:
And then use the generic in the prop definition:
If this change makes sense, I’d be happy to help by submitting a PR.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: