Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 迭代html表中的数组并使用print.printToFileAsync打印_Javascript_Html_React Native_Expo - Fatal编程技术网

Javascript 迭代html表中的数组并使用print.printToFileAsync打印

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>

我试图在print.printToFileAsync函数的html中打印一个表。但是我在遍历数组并在表中插入数据时遇到了麻烦

         <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}
))}
我得到了这个结果:

如何迭代数组以正确填充表