如何解决如果车把上有其他变量,如何在内部使用每个?
我需要在 2 个按钮中使用 id,该 id 是订单的参考,当我比较用户的角色时可能会出现问题,因为按钮采用用户的 id 而不是订单的 id。
这是我的代码:
{{#each orders}}
<tr>
<th>{{title}}</th>
<th>{{description}}</th>
<th>{{status}}</th>
<th>
{{#compare status '!=' 'CLOSED'}}
{{#compare status '!=' 'CANCELLED'}}
{{!-- Open modal change status --}}
<button type="button" class="btn btn-outline-primary" data-bs-toggle="tooltip" data-bs-placement="top" title="Edit order">
<a href="/orders/change-status/{{_id}}"><i class="fas fas fa-exchange-alt"></i></a>
</button>
{{!-- edit button --}}
<button type="button" class="btn btn-outline-primary" data-bs-toggle="tooltip" data-bs-placement="top" title="Edit order">
<a href="/orders/edit/{{_id}}"><i class="fas fa-edit"></i></a>
</button>
{{/compare}}
{{/compare}}
<button type="button" class="btn btn-outline-primary" data-bs-toggle="tooltip" data-bs-placement="top" title="view detail">
<a href="/orders/view-order/{{_id}}"><i class="fas fa-eye"></i></a>
</button>
</th>
</tr>
{{/each}}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。