我正在使用node-xslx生成一个excel文件,有两列需要使用HTML格式数据作为单元格的值,该文档告诉我它支持我们使用其他{{3} },但我仍然不知道如何实现。
由于以下代码,我已经尝试了许多方法,但所有方法都不起作用:
import xlsx from 'node-xlsx'
...
const reportExcel = [];
// way one, print html text as plain text
reportExcel.push(['some html code']);
// way two, print [object Object]
reportExcel.push([{h: 'some html code'}]);
reportExcel.push([{r: 'some html code'}]);
// way three, print [object Object]
reportExcel.push([{t: 's', h: 'some html code'}]);
reportExcel.push([{t: 's', r: 'some html code'}]);
// way four, print [object Object]
reportExcel.push([{t: 's', v: 'some html code', h: 'some html code'}]);
xlsx.build([
{
name: `${week}`,
data: reportExcel,
},
]);