这是一个创建于 754 天前的主题,其中的信息可能已经有所发展或是发生改变。
使用技术 react + antd +TS
const columns: ColumnsType<DataType> = [
{
title: "创建者",
dataIndex: "creator",
key: "creator",
},
.....]
<Table
columns={columns}
dataSource={analogDataTable(columns)}
/>
// 这是一个自定义通用模拟表格数据的方法
export const analogDataTable = (columns: (请问这里该如何定义类型?)) => {.......}
2 条回复 • 2022-06-13 17:47:02 +08:00
![RNAer](https://cdn.v2ex.com/avatar/8ede/44ca/296827_normal.png?m=1655082799) |
|
1
RNAer 2022-06-13 17:29:02 +08:00
ColumnsType<DataType>
|
![iidear2015](https://cdn.v2ex.com/gravatar/56062dc96d6af64422e89249379802b0?s=48&d=retro) |
|
2
iidear2015 2022-06-13 17:47:02 +08:00
<T>(x: ColumnsType<T>) => ColumnsType<T>
|