-
-
Notifications
You must be signed in to change notification settings - Fork 619
Expand file tree
/
Copy pathmeasureRowRender.tsx
More file actions
47 lines (42 loc) · 997 Bytes
/
measureRowRender.tsx
File metadata and controls
47 lines (42 loc) · 997 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import React from 'react';
import Table from 'rc-table';
// 示例:使用 measureRowRender 来隐藏 MeasureRow 中的弹层
const MeasureRowRenderExample = () => {
const columns = [
{
title: (
<div>
Name
<div className="filter-dropdown" style={{ display: 'none' }}>
Filter Content
</div>
</div>
),
dataIndex: 'name',
key: 'name',
width: 100,
},
{
title: 'Age',
dataIndex: 'age',
key: 'age',
width: 80,
},
];
const data = [
{ key: 1, name: 'John', age: 25 },
{ key: 2, name: 'Jane', age: 30 },
];
// 自定义 MeasureRow 渲染,隐藏弹层内容
const measureRowRender = measureRow => <div style={{ display: 'none' }}>{measureRow}</div>;
return (
<Table
columns={columns}
data={data}
sticky
scroll={{ x: true }}
measureRowRender={measureRowRender}
/>
);
};
export default MeasureRowRenderExample;