-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat(useVirtualList): add useVirtualList function #710
Conversation
Does the usage for this function requires certain styles on the client side? If so, I'd feel it's better to be wrapped with a component instead of a compassable function for easier usage (which in this way, will be out-of-scope of VueUse) |
This is the minimal requirement of useVirtualList.
|
Yes, It's more like a headless component. Sometimes component libraries do not fully meet our requirements. For example, component's style is not satisfied, but we need their internal logic. Unfortunately, current vue component library does not support using without UI. I believe the composition API can solve this problem. Will vueuse take consider of headless component ? My English is not very good, thanks. |
I had the same idea, but I don't think this implementation is very elegant after trying |
I see. That does make some sense. We do have some headless versions of compsoables. https://vueuse.org/guide/components.html I guess for this, we might better to advocate to use component version first, then fallback to composable for advanced usages. /cc @wheatjs WDYT? |
Seems like it would be useful. Wondering about how this might work on the body though. Like if you wanted the scroll container to be the body not sure if that would be possible with the renderless component unless maybe we allow users to set that as a prop. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you reduce the usage example in README.md
to show the minimal requirements?
Also, it would be great if you can create component.ts
for headless component in @vueuse/components
(Refer to a4199cd)
Thanks.
OK, I'll do it tomorrow. |
3d4d84b
to
5ac9522
Compare
Hi, I think It's ready ! @antfu |
Thanks! |
hi~, I hope to do a trivial thing for vueuse:
virtual list migrating from ahooks to Composition API