如果车把上有其他变量,如何在内部使用每个?

问题描述

我需要在 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 (将#修改为@)