我想在网格中添加一个额外的列来反映其他两列的最新总和:
const columnDef = [
{headerName: 'x', field: 'x', type: 'numericColumn'},
{headerName: 'y', field: 'y', type: 'numericColumn'},
{headerName: 'z', function: (data) => data.x+data.y}
];
我怎样才能做到这一点?
看看这个。它可以在对象数组中使用来组合属性Reduce