ant design vue table 使用rowClassName隔行换色
<a-tablebordered:size="size":columns="columns":data-source="data":row-selection="rowSelection":row-key="record => record.id":pagination="pagination":rowClassName="rowClassName"@change="h.
·
<a-table :rowClassName="rowClassName">
methods: {
rowClassName(record,index) {
let className = "light-row";
if (index % 2 === 1) className = "dark-row";
return className;
},
}
<style>
.light-row {background-color: #fff;}
.dark-row {background-color: #fafafa;}
</style>
更多推荐
已为社区贡献4条内容
所有评论(0)