Javascript 迭代html表中的数组并使用print.printToFileAsync打印
我试图在print.printToFileAsync函数的html中打印一个表。但是我在遍历数组并在表中插入数据时遇到了麻烦Javascript 迭代html表中的数组并使用print.printToFileAsync打印,javascript,html,react-native,expo,Javascript,Html,React Native,Expo,我试图在print.printToFileAsync函数的html中打印一个表。但是我在遍历数组并在表中插入数据时遇到了麻烦 <table> <thead> <tr> <th>Item 1</th> <th>Item 2</th> <th>Item 3</th>
<table>
<thead>
<tr>
<th>Item 1</th>
<th>Item 2</th>
<th>Item 3</th>
</tr>
</thead>
<tbody>
${_.map(itens, (item) => (
<tr>
<td>{item.code}</td>
<td>{item.name}</td>
<td>{item.value}</td>
</tr>
))}
</tbody>
</table>
项目1
项目2
项目3
${{.map(iten,(item)=>(
{item.code}
{item.name}
{item.value}
))}
我得到了这个结果:
如何迭代数组以正确填充表