element table 动态设置表头className

在 el-table 上添加 :header-cell-class-name="HeaderCellClassName"
HeaderCellClassName({ row, column, rowIndex, columnIndex }) {
            if (columnIndex === 0) {
                return 'custom-style'
            }
            if (columnIndex === 3) {
                return 'box-style'
            }
        },

就会在表头索引为0和3上添加对应的class

posted @ 2023-03-17 10:47  龙卷风吹毁停车场  阅读(838)  评论(0)    收藏  举报