Skip to content

feat(table): update table props, enable loadingMode prop - #927

Open
slatejack wants to merge 29 commits into
Tencent:developfrom
slatejack:feature/table-v2
Open

feat(table): update table props, enable loadingMode prop#927
slatejack wants to merge 29 commits into
Tencent:developfrom
slatejack:feature/table-v2

Conversation

@slatejack

@slatejack slatejack commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

fix #925

相关 PRs

TDesignOteam/tdesign-api#878
Tencent/tdesign-common#2556

💡 需求背景和解决方案

📝 更新日志

  • feat(Table): 拓展表格组件能力,新增 loadingMode 等多个属性

  • 本条 PR 不需要纳入 Changelog

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

完成

@codecov-commenter

codecov-commenter commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 52.34375% with 488 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.19%. Comparing base (02b774b) to head (cc14a39).
⚠️ Report is 431 commits behind head on develop.

Files with missing lines Patch % Lines
src/table/hooks/useDragSort.ts 28.89% 155 Missing ⚠️
src/table/hooks/useSorter.tsx 43.39% 60 Missing ⚠️
src/table/hooks/useFilter.tsx 36.48% 47 Missing ⚠️
src/table/hooks/usePullRefresh.tsx 58.40% 47 Missing ⚠️
src/table/hooks/useRowSelect.tsx 64.34% 41 Missing ⚠️
src/table/hooks/useRowExpand.tsx 31.57% 39 Missing ⚠️
src/table/PrimaryTable.tsx 73.41% 21 Missing ⚠️
src/table/hooks/usePagination.tsx 62.96% 20 Missing ⚠️
src/table/FilterController.tsx 64.70% 18 Missing ⚠️
src/table/BaseTable.tsx 81.15% 13 Missing ⚠️
... and 5 more
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pkg-pr-new

pkg-pr-new Bot commented Jun 24, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/tdesign-mobile-react@927

commit: cc14a39

Comment thread src/table/_example/loading.tsx Outdated
Comment thread src/table/_example/loading.tsx
if (!isPulling && !isLoadingMore) return null;
return (
<div className={`${classPrefix}-table-loading--bottom`}>
<Loading text="加载中..." {...loadingProps} loading={true} />

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

上拉 loading 文案硬编码,未走国际化

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已在 common 仓库中新增

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已在 common 仓库中新增

应接入 useLocaleReceiver,与筛选/排序的 locale 用法保持一致、

Comment thread src/table/BaseTable.tsx
Comment thread src/table/BaseTable.tsx Outdated
Comment thread src/table/hooks/usePullRefresh.tsx Outdated
Comment thread src/table/hooks/useColumnResize.tsx Outdated
Comment thread src/table/tablePaginationDefaultProps.ts
@anlyyao

anlyyao commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

组件功能/体验问题:@slatejack 辛苦大佬有空在处理一波 👀👀

  • 拖拽功能无效
  • 单选图标被遮挡
  • 单选/多选图标尺寸错误,正确尺寸为 16px*16px
  • 带操作示例中,操作栏 Button 左右间距错误
  • 缺少升降序、筛选示例

录屏:https://github.com/user-attachments/assets/b20350cd-7334-46e9-8272-29ad6e358c43

@slatejack

Copy link
Copy Markdown
Collaborator Author

组件功能/体验问题:@slatejack 辛苦大佬有空在处理一波 👀👀

  • 拖拽功能无效
  • 单选图标被遮挡
  • 单选/多选图标尺寸错误,正确尺寸为 16px*16px
  • 带操作示例中,操作栏 Button 左右间距错误
  • 缺少升降序、筛选示例

录屏:https://github.com/user-attachments/assets/b20350cd-7334-46e9-8272-29ad6e358c43

已处理~需先合并 common 仓库后再更新~

};
return (
<div className={tablePaginationClasses.content}>
<Button

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

直接使用描边按钮

Image

};
return (
<div className="loading-example-table">
<div className="loading-example-title">单选</div>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image Image

// 绑定触摸事件
useEffect(() => {
const container = containerRef.current;
if (!container || !pagination || loadingMode !== 'pull-refresh') {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

container 是不是得加个判空?


// 当切换分页时,内容区域滚动到顶部
const ref = tableContentRef.current;
if (ref.scrollTo) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ref?.scrollTo

return arr;
};

const tColumns = (() => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tColumns、tRowClassNames、tRowAttributes 都是渲染执行的 IIF,getColumns递归处理列,又在其中构造新 title 函数,大表频繁重算。建议使用 useMemo 缓存

...props.dragSortOptions,
};

if (!dragContainer) return;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

体验拖拽示例后,页面变的不可滚动

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Table] 表格组件功能增强

3 participants