官方文档:
在这里插入图片描述

代码:

const columns = [
  {
    title: 'Identity',
    dataIndex: 'Identity',
    key: 'Identity',
    width: '10%',
  },
  {
    title: 'Path',
    dataIndex: 'Path',
    key: 'Path',
    width: '10%',
  },
  {
    title: 'Reason',
    dataIndex: 'Reason',
    key: 'Reason',
  },
  {
    title: 'Replay',
    dataIndex: 'Replay',
    key: 'Replay',
    width: '30%',
  },
  {
    title: 'Online',
    dataIndex: 'Online',
    key: 'Online',
    width: '30%',
  },
];

const transformColumns = columns.map((column) => ({
  ...column,
  onCell: (record: any) => ({ style: { background: record.Highlight ? '#fff2f0' : undefined } }), // 这里
}));

效果:
在这里插入图片描述

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐