【发布时间】:2020-08-06 00:29:10
【问题描述】:
我正在为 ant design table 使用我的反应类型脚本项目 我想知道如何像表格一样执行以下图像,我搜索任何教程但没有看到任何内容,任何人都知道如何正确地做到这一点。
谢谢
图片在这里
代码在这里
class App extends React.Component {
columns: any = [
{
title: "Name",
dataIndex: "name",
key: "name"
},
{
title: "Age",
dataIndex: "age",
key: "age"
},
{
title: "Address",
dataIndex: "address",
key: "address"
},
{
title: "Tags",
key: "tags",
dataIndex: "tags"
},
{
title: "Action",
key: "action"
}
];
data: any = [
{
key: "1",
name: "John Brown",
age: 32,
address: "New York No. 1 Lake Park",
tags: ["nice", "developer"]
},
{
key: "2",
name: "Jim Green",
age: 42,
address: "London No. 1 Lake Park",
tags: ["loser"]
},
{
key: "3",
name: "Joe Black",
age: 32,
address: "Sidney No. 1 Lake Park",
tags: ["cool", "teacher"]
}
];
render() {
return <Table columns={this.columns} dataSource={this.data} />;
}
}
【问题讨论】:
标签: reactjs antd ant-design-pro react-typescript