el-table样式设置

    科技2024-06-29  71

    官网的说明里没有讲清楚

    以上图中框出的两个属性进行说明,只需要返回style字符串就可以

    <el-table :header-cell-style="headerCellStyle" :cell-style="cellStyle"></el-table>

    然后再script里

    headerCellStyle({ row, rowIndex }) { return 'background-color: #F2F6FF;text-align: center;' }, cellStyle({ row, rowIndex }) { return 'text-align: center;' }

    这样就能生效了

    Processed: 0.009, SQL: 8