Vue给table指定行加样式
需求:动态表格指定行加样式
解决方法::cell-style="cellStyle"
适用表格插件:Element、vxe-table
注:本文以vxe-table表格插件示例,Element表格同理
示例:给动态表格第2行、第3行、第5行字体加粗
else border stripe :data="dataSource" :cell-style="cellStyle" > for="item in tableColumn" :field="item" :title="item">
methods:{ cellStyle(row,column,rowIndex,columnIndex){ console.log(row,column,rowIndex,columnIndex) if (row.seq == '10' ||row.seq == '11'|| row.seq == '13') { return `font-weight:bolder!important;`; } else { return '' } } }