feat(table): update table props, enable loadingMode prop - #927
feat(table): update table props, enable loadingMode prop#927slatejack wants to merge 29 commits into
Conversation
BREAKING CHANGE: export props type name change
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #927 +/- ##
============================================
+ Coverage 6.93% 56.19% +49.26%
============================================
Files 400 316 -84
Lines 4241 9015 +4774
Branches 990 2486 +1496
============================================
+ Hits 294 5066 +4772
- Misses 3947 3949 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
commit: |
| if (!isPulling && !isLoadingMore) return null; | ||
| return ( | ||
| <div className={`${classPrefix}-table-loading--bottom`}> | ||
| <Loading text="加载中..." {...loadingProps} loading={true} /> |
There was a problem hiding this comment.
已在 common 仓库中新增
应接入 useLocaleReceiver,与筛选/排序的 locale 用法保持一致、
|
组件功能/体验问题:@slatejack 辛苦大佬有空在处理一波 👀👀
录屏:https://github.com/user-attachments/assets/b20350cd-7334-46e9-8272-29ad6e358c43 |
…n loadingMode is configured
已处理~需先合并 common 仓库后再更新~ |
| }; | ||
| return ( | ||
| <div className={tablePaginationClasses.content}> | ||
| <Button |
| }; | ||
| return ( | ||
| <div className="loading-example-table"> | ||
| <div className="loading-example-title">单选</div> |
| // 绑定触摸事件 | ||
| useEffect(() => { | ||
| const container = containerRef.current; | ||
| if (!container || !pagination || loadingMode !== 'pull-refresh') { |
|
|
||
| // 当切换分页时,内容区域滚动到顶部 | ||
| const ref = tableContentRef.current; | ||
| if (ref.scrollTo) { |
| return arr; | ||
| }; | ||
|
|
||
| const tColumns = (() => { |
There was a problem hiding this comment.
tColumns、tRowClassNames、tRowAttributes 都是渲染执行的 IIF,getColumns递归处理列,又在其中构造新 title 函数,大表频繁重算。建议使用 useMemo 缓存
| ...props.dragSortOptions, | ||
| }; | ||
|
|
||
| if (!dragContainer) return; |
There was a problem hiding this comment.
line 168 行已 if (!dragContainer) return null;,line 311 行又判一次,冗余
|
|
||
| export default function DragSortExample() { | ||
| return ( | ||
| <Table columns={columns} data={data} dragSort="row" cellEmptyContent={'vvv'} rowKey="index" showHeader></Table> |




🤔 这个 PR 的性质是?
🔗 相关 Issue
fix #925
相关 PRs
TDesignOteam/tdesign-api#878
Tencent/tdesign-common#2556
💡 需求背景和解决方案
📝 更新日志
feat(Table): 拓展表格组件能力,新增
loadingMode等多个属性本条 PR 不需要纳入 Changelog
☑️ 请求合并前的自查清单