import React from 'react';
import './index.less';
function Table(props) {
const { columns = [], data = [] } = props;
return (
{columns.map(column => {
return (
{column.title}
);
})}
{data.length === 0 &&
暂无数据
}
{data.map(row => {
return (
{columns.map(column => {
return (
{column.render ? column.render(row, row[column.key]) : row[column.key]}
);
})}
);
})}
);
}
Table.propTypes = {};
export default Table;