【发布时间】:2022-01-03 14:30:59
【问题描述】:
我正在编写一个带有 react 和 ant design 的应用程序
我要使用antd表
但它没有显示我的数据
代码
const ListOfProperties = () => {
const columns = [
{
type: "Type",
state: "State",
location: "Location",
},
];
const properties = [
{
type: "Flat",
state: "Anambra",
location: "Udoka",
},
{
type: "Flat",
state: "Anambra",
location: "Udoka",
},
];
return (
<Skeleton active loading={loading}>
<Table columns={columns} dataSource={properties} />
</Skeleton>
);
};
export default ListOfProperties;
我创建了一个对象数组,我将它们传递给数据源并将列传递给列
如文档中所述
但我遇到了错误
错误
Type '{ type: string; state: string; location: string; }' has no properties in common with type 'ColumnType<any>'.
【问题讨论】:
标签: reactjs typescript antd