0
点赞
收藏
分享

微信扫一扫

ant design vue:表格隔行换色

书呆鱼 2022-01-09 阅读 130
vue.js前端
<template>
	<div>
		<a-table :columns="columns" :data-source="data" bordered :customRow="customRow">
		</a-table>
	</div>

</template>
methods: {
			//设置表格隔行变色
			customRow(record, index) {
				return {
					style: {
						// 字体颜色
						color: record.remarkDesc ? record.remarkDesc.fontColor : '#262626',
						// 行背景色
						'background-color': index % 2 == 0 ? '#FAFAFA' : '#FFFFFF'
					}
				}
			},
}
举报

相关推荐

0 条评论