Skip to content

Commit 37b2602

Browse files
committed
feat(table): add ContentWordsItem demo with ProTable integration
- Introduced a new demo component for displaying content words using ProTable. - Implemented a mock data generator for testing with 100 entries. - Configured table columns and filtering options for better data representation.
1 parent 3d883e7 commit 37b2602

File tree

2 files changed

+944
-0
lines changed

2 files changed

+944
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { ProColumns, ProTable } from '@ant-design/pro-components';
2+
3+
type ContentWordsItem = {
4+
id: string;
5+
problemCause: string;
6+
};
7+
8+
const getData = () => {
9+
const arr = Array.from({ length: 100 }).map((_, idx) => ({
10+
id: (idx + 1).toString(),
11+
problemCause: 'problemCause',
12+
}));
13+
return arr;
14+
};
15+
16+
export default () => {
17+
const columns: ProColumns<ContentWordsItem>[] = [
18+
{
19+
disable: true,
20+
title: '问题标注',
21+
dataIndex: 'problemCause',
22+
editable: false,
23+
onFilter: false,
24+
ellipsis: true,
25+
search: true,
26+
valueType: 'select',
27+
width: 180,
28+
},
29+
];
30+
31+
return (
32+
<div>
33+
<ProTable<ContentWordsItem>
34+
rowKey="id"
35+
columns={columns}
36+
request={async () => {
37+
const data = getData();
38+
return {
39+
data: data,
40+
total: data.length,
41+
success: true,
42+
};
43+
}}
44+
/>
45+
</div>
46+
);
47+
};

0 commit comments

Comments
 (0)