我有一个包含 3 个部分的 div。
<div>
<section> /--bind table Table.html template with HR Details--/</section>
<section> /--bind table Table.html template with Developers--/</section>
<section> /--bind table Table.html template with Managers--/</section>
</div>
我有一个表格模板,即 Table.html
<table id="emptable">
<thead>
<tr>
<th>Name</th>
<th>Designation</th>
</tr>
</thead>
<tbody data-bind="foreach: EmpDetails">
<tr>
<td style="width:25%" data-bind="text: Name"></td>
<td style="width:25%" data-bind="text: Designation"></td>
</tr>
</tbody>
</table>
我想在所有 3 个部分中使用同一张表,并使用不同的 observables。例如:我的 Obserevables 是 HRDetails、Develeopers、Managers。我想在具有不同观察值的所有部分中使用相同的表结构。请建议我如何在knockoutjs中做到这一点。