-
Notifications
You must be signed in to change notification settings - Fork 577
feat(cascader): support virtual scroll api #6117
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
base: develop
Are you sure you want to change the base?
Conversation
TDesign Component Site Preview Open
|
commit: |
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.
Pull Request Overview
This PR adds virtual scrolling support to the Cascader component to improve performance with large datasets. The implementation leverages the existing list component's virtual scroll hook and introduces a new scroll prop that accepts a TScroll configuration.
Key changes:
- Added
scrollprop to Cascader component type definitions and props - Refactored Panel component to use a new List component for rendering cascader items
- Created a new List component that implements virtual scrolling using the
useListVirtualScrollhook - Added example files demonstrating virtual scroll usage
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/components/cascader/type.ts | Added TScroll import and scroll prop type definition |
| packages/components/cascader/props.ts | Added scroll prop definition |
| packages/components/cascader/components/Panel.tsx | Refactored to use new List component instead of inline rendering |
| packages/components/cascader/components/List.tsx | New component implementing virtual scroll for cascader items |
| packages/components/cascader/cascader.tsx | Passed scroll prop to Panel component |
| packages/components/cascader/cascader.md | Added documentation for scroll prop (Chinese) |
| packages/components/cascader/cascader.en-US.md | Added documentation for scroll prop (English) |
| packages/components/cascader/cascader-panel.tsx | Passed scroll prop to Panel component |
| packages/components/cascader/_example/virtual-scroll.vue | Added example demonstrating virtual scroll usage |
| packages/components/cascader/_example-ts/virtual-scroll.vue | Added TypeScript example demonstrating virtual scroll usage |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

🤔 这个 PR 的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
support virtual scroll api
📝 更新日志
tdesign-vue-next
scrollAPI,支持懒加载和虚拟滚动。☑️ 请求合并前的自查清单