ant table 隔行变色

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;
}

你可能感兴趣的:(ant table 隔行变色)