最近做个表格,想做隔行换色以及自定义单元格数据展示的效果,到网上找了一些方法,算是大概实现了,记录一下。(总结还是一句话,多看API文档)
table页面展示
constructor() {
...
this.columns = [{
title: 'Research Topic',
dataIndex: 'name',
sorter: true,
className: 'topic-info',
render: (text, record) => (
{text.split("|")[0]}
{text.split("|")[1]}
),
}, {
title: 'Researchers',
dataIndex: 'creatorName',
sorter:true,
width: '15%',
}, {
title: 'Created',
dataIndex: 'created',
sorter: true,
width: '12%',
}, {
title: 'Updated',
dataIndex: 'updated',