Error: A Cell needs a Row
原因分析:
worksheet.getCell(i, j);中i,j不能是0.
解决方案:
for (let i = 1; i <= self.table_3Data.length+1; i++) {
for (let j = 1; j <= realColArray.length; j++) {
const dataCell = worksheet.getCell(i, j);
dataCell.border = {
top: { style: "thin", color: { argb: "FF000000" } },
left: { style: "thin", color: { argb: "FF000000" } },
bottom: { style: "thin", color: { argb: "FF000000" } },
right: { style: "thin", color: { argb: "FF000000" } },
};
}
}