var ws = XLSX.utils.json_to_sheet(data);
ws.set_column('Y1', None, None, {'hidden': True});
/* add to workbook */
var wb = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(wb, ws, 'content');
/* generate an XLSX file */
XLSX.writeFile(wb, 'test.xlsx');
}
我正在使用这样的角度 4 导出 json 对象,它给了我预期的结果。
但是当我试图隐藏特定列时
/* hide column*/
if (this.column === 'No') {
ws.set_column('A1', None, None, {'hidden': True});
}
在此代码中,它给了我错误None
,true
即找不到名称 none 和 true。