packages/core/src/table/util.js
function getColspanNum(data = [], num = 1) {
  let childs = [];
  for (let i = 0; i < data.length; i += 1) {
    if (data[i].children) {
      childs = childs.concat(data[i].children);
    }
  }
  if (childs && childs.length > 0) {
    num = getColspanNum(childs, num + 1);
  }
  return num;
}
function getColspanNum(data = [], num = 1) {
  let childs = [];
  for (let i = 0; i < data.length; i += 1) {
    if (data[i].children) {
      childs = childs.concat(data[i].children);
    }
  }
  if (childs && childs.length > 0) {
    num = getColspanNum(childs, num + 1);
  }
  return num;
}
function getColspanNum ( data = [ ] , num = 1 ) { let childs = [ ] ; for ( let i = 0 ; i < data . length ; i += 1 ) { if ( data [ i ] . children ) { childs = childs . concat ( data [ i ] . children ) ; } } if ( childs && childs . length > 0 ) { num = getColspanNum ( childs , num + 1 ) ; } return num ; }
Get colspan number
@param {Array} date
Get colspan number