js
import styles from '/Task.less';
...........................................
<Table rowKey={(item, index) => index}
columns={columns}
dataSource={data}
pagination={pagination}
rowClassName={(record, index) => { return index % 2 === 1?styles.once:styles.twoe }}
/>
Task.less
.once{
background:rgba(248,248,248,1);
height: 35px;
}
.twoe{
background:rgba(255,255,255,1);
height: 35px;
}
本文介绍如何使用AntDesign中的Table组件,并通过Less样式语言自定义表格行的背景颜色,实现隔行显示效果。
297

被折叠的 条评论
为什么被折叠?



