实现效果:
代码:
html:
<a-table
:columns="stockColumns"
:data-source="stockData"
class="ant-table-striped"
:rowClassName="rowClassName"
>
</table>
js:
const rowClassName = computed(() => {
return (record, index: number) => (index === 0 ? 'darkYellow' : '');
});
css:
:deep(.ant-table-thead > tr > th) {
background: rgb(255, 249, 243);
}
.ant-table-striped :deep(.darkYellow) td {
background-color: rgb(255, 233, 214);
}