element-ui表格组件添加背景样式 找到element-ui的表格组件 在el-table中给行样式添加一个方法classCell <el-table :header-cell-style="classCell"></el-table> 在methods中写入方法: classCell(){ return "background:#f70;color:#fff;font-weight:600" }, 就可以在返回的数据内部写入样式