我想实现一种类型体操,达到从 FieldType 和 columns 中获得 Record 的能力
enum FieldType {
number,
string,
boolean
}
const columns = [
{
title: '姓名',
dataIndex: 'name',
type: FieldType.string,
},
{
title: '邮件',
dataIndex: 'email',
type: FieldType.string,
},
{
title: '电话',
dataIndex: 'phone',
type: FieldType.number,
},
{
title: '性别',
dataIndex: 'gender',
type: FieldType.boolean,
},
];
interface Record {
name: string;
email: string;
phone: number;
gender: boolean;
}