有这么一个需求,在一个table中,tr是通过each取值,取出的值要与table标题相对应,如何实现?例如:

<table>
  <thead>
    <tr>
    {{#each 标题集合,值举例[name,sex...]}}
      {{this}}
    {{/each}}
       得到结果应是
       <th>name</th>
       <th>sex</th>
    </tr>
  </thead>
 <tbody>
  {{#each 内容集合,值举例[{name:'苏轼',sex:'男'},{name:'李清照',sex:'女'}...]}}
      此时我想得到这样的数据,与标题想对应,该如何做呢?
      <tr>
         <td>苏轼</td>
         <td></td>
      </tr>
      <tr>
        <td>李清照</td>
        <td></td>
      </tr>
    {{/each}}
 </tbody>
</table>
View Code

相关文章:

  • 2022-01-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-24
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
  • 2021-10-01
  • 2021-07-30
相关资源
相似解决方案