本帖最后由 牛马大队 于 2021-7-9 15:00 编辑
请问如何讲单元格设置为空,目前设置空字符串输入不生效:- const emptyArray = ['', '', '', '', '', '',] //←←←
- const titleArray = ['Level', 'Category', 'Brand', 'Sub Category', 'Product line', 'Store']
- const headerRow = emptyArray.concat(monthDays)
- const headerSubRow = titleArray.concat(weekArray)
- sheet.setArray(0, 0, [
- headerRow,
- headerSubRow
- ])
复制代码
但如果设置这样的数组就可以:
- const emptyArray = [' ', ' ', ' ', ' ', ' ', ' ',] //←←←
- const titleArray = ['Level', 'Category', 'Brand', 'Sub Category', 'Product line', 'Store']
- const headerRow = emptyArray.concat(monthDays)
- const headerSubRow = titleArray.concat(weekArray)
- sheet.setArray(0, 0, [
- headerRow,
- headerSubRow
- ])
复制代码 |
|