在<el-table>中加 :row-class-name="tableRowClassName"
methods: {
// 改变斑马线的颜色
tableRowClassName({row, rowIndex}) {
if (rowIndex % 2 === 0 ) {
return 'row-style';
}
return '';
},
}
<style scoped>
::v-deep .el-table .row-style {
background: #f7fdfd;
}
<style>