表格数据兜底处理

const dataList = [
  { f1: '', f2: null, f3: undefined },
  { f1: '零', f2: '0', f3: 0 }
]

const columnList = [
  { index: 'f1', label: '列一' },
  { index: 'f2', label: '列二' },
  { index: 'f3', label: '列三' },
  { index: 'f4', label: '列四' }
]

dataList.forEach(it => columnList.forEach(({ index: column }) => (it[column] = it[column] || '')))

console.log(dataList)