更复杂的分组表头
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- react, typescript
- 领域
- frontend
调研方向
从复现的 Table 示例及其使用 colSpan 和 rowSpan 的嵌套列开始;该示例导入 ../../assets/index.less。比较分组表头的预期渲染结果与实际渲染结果,然后检查 Table 的渲染路径。当示例生成预期的多级分组表头,且不会使更简单的表头发生回归时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
更复杂分组表头的渲染
期望渲染结果:
实际渲染结果:
示例复现的代码
import React from 'react';
import type { TableProps } from 'rc-table';
import Table from 'rc-table';
import '../../assets/index.less';
const columns: TableProps['columns'] = [
{
title: '姓名',
rowSpan: 4,
dataIndex: 'name',
key: 'name',
},
{
title: '出勤',
colSpan: 3,
rowSpan: 3,
children: [
{
title: '出勤',
dataIndex: 'attendance',
key: 'attendance',
},
{
title: '迟到',
dataIndex: 'late',
key: 'late',
},
{
title: '请假',
dataIndex: 'leave',
key: 'leave',
},
],
},
{
title: '其它',
colSpan: 4,
children: [
{
title: '年龄',
dataIndex: 'age',
key: 'age',
rowSpan: 3,
},
{
title: '住址',
colSpan: 3,
children: [
{
title: '街道',
dataIndex: 'street',
key: 'street',
rowSpan: 2,
},
{
title: '小区',
colSpan: 2,
children: [
{
title: '单元',
dataIndex: 'building',
key: 'building',
},
{
title: '门牌',
dataIndex: 'number',
key: 'number',
},
],
},
],
},
],
},
{
title: '技能',
colSpan: 2,
rowSpan: 2,
children: [
{
title: '前端',
dataIndex: 'frontend',
key: 'frontend',
rowSpan: 2,
},
{
title: '后端',
dataIndex: 'backend',
key: 'backend',
rowSpan: 2,
},
],
},
{
title: '公司',
colSpan: 2,
children: [
{
title: '地址',
dataIndex: 'companyAddress',
key: 'companyAddress',
rowSpan: 3,
},
{
title: '名称',
dataIndex: 'companyName',
key: 'companyName',
rowSpan: 3,
},
],
},
{
title: '性别',
dataIndex: 'gender',
key: 'gender',
rowSpan: 4,
},
];
const data = [
{
key: '1',
name: '胡彦斌',
attendance: 20,
late: 0,
leave: 1,
age: 32,
street: '拱墅区和睦街道',
building: 1,
number: 2033,
frontend: 'S',
backend: 'S',
companyAddress: '西湖区湖底公园',
companyName: '湖底有限公司',
gender: '男',
},
{
key: '2',
name: '胡彦祖',
attendance: 20,
late: 0,
leave: 1,
age: 42,
street: '拱墅区和睦街道',
building: 3,
number: 2035,
frontend: 'S',
backend: 'S',
companyAddress: '西湖区湖底公园',
companyName: '湖底有限公司',
gender: '男',
},
];
const Demo = () => (
<div>
<h2>grouping columns specified colSpan & rowSpan</h2>
<Table columns={columns} data={data} className="bordered" />
</div>
);
export default Demo;
不知是否有支持计划,如有可以提交相关 PR
- 主要语言
- TypeScript
- 星标
- 1.4k
- 派生
- 619
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
react-component/table 的其他 Issue
-
Fixed-header tables force one getBoundingClientRect per column on every mount (ResizeObserver-driven MeasureCell)可能已有人在做 @rubenmarcus 于 11 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 42/100
react-component/table#1507 ·
-
rowExpandable does not work when dataSource has children field可能已有人在做 @nrps9909 于 46 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 50/100
react-component/table#1416 ·
-
难度 5/5 一周以上 新手友好度 30/100
react-component/table#1403 ·
-
难度 5/5 一周以上 新手友好度 15/100
react-component/table#1269 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
react-component/table#1257 · 1 个 reaction ·
查看 react-component/table 的全部 Issue
相似的 Issue
-
area:deploy task
难度 2/5 1-3 小时 新手友好度 72/100
wilanis/wilanis-js#1017 ·
维护者通常 1 天内回复
-
documentation v2
难度 2/5 1-3 小时 新手友好度 76/100
modelcontextprotocol/servers#5133 ·
维护者通常 1 天内回复
-
budget bug feature frontend good-issue medium needs-review OSCI'26 payments
难度 2/5 1-3 小时 新手友好度 75/100
SatyamPandey-07/WorkSphere#5990 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
lugassawan/swe-workbench#799 ·
维护者通常 1 天内回复
-
bug good first issue javascript
难度 2/5 1-3 小时 新手友好度 82/100
yukikotani231/sqlsift#326 ·
维护者通常 1 天内回复