ElementUI 实现Table 表列合并,第一行保持,第二列开始合并

学习 · 前天
 objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  // 只处理第一列
  if (columnIndex === 0) {
    // 第二行开始合并
    if (rowIndex >= 1) {
      // 第二行显示合并单元格,其他行隐藏
      if (rowIndex === 1) {
        return { rowspan: this.cooperateHistory.length - 1, colspan: 1 };
      } else {
        return { rowspan: 0, colspan: 0 };
      }
    }
  }
  // 其他情况正常显示
  return { rowspan: 1, colspan: 1 };
}

ScreenShot_2025-10-17_123553_630.png

Theme Jasmine by Kent Liao | 桂ICP备15008025号-6