The method of merging the element- UI table header is as follows:

  • Now:

  • Expectations:

Code:

 <el-table ref="tableRef" v-loading="loadingTab" class="table" :data="tableData" height="100%" 
size="mini" border :span-method="spanMethod" :header-cell-style="headerStyle">
      <el-table-column prop="positionName" label="Jobs" width="200px">
      </el-table-column>.Copy the code
  headerStyle ({ row, column, rowIndex, columnIndex }: any) {
    row[2].colSpan = 2
    row[3].colSpan = 0
    if (columnIndex === 3) {
      return 'display: none'}}Copy the code