手动将按钮添加到材料用户界面表中的行

时间:2020-10-12 19:21:59

标签: reactjs dictionary material-ui

我正在使用的这种类型的表(数据表)中,我必须像这样定义行和列(我使用map将按钮添加到从外部获取的数据中)

const finalData = data.map(({id, first_name, last_name, email, phone, attorney, leadType, date}) => ({id, first_name, last_name, email, phone, attorney, leadType, date, action: <button>button</button>}))
const rows = finalData;

<DataGrid rows={rows} columns={columns} pageSize={5} checkboxSelection />

但是在我的行中我没有按钮,而是得到了[object object]我该如何解决?

0 个答案:

没有答案