如何将复选框添加到 #{{链接到}} 帮助程序中

How do I add a Checkbox into a #{{link-to}} Helper

本文关键字:帮助程序 链接 添加 复选框      更新时间:2023-09-26

问题:我有一个表格,每个表格中都有一个链接。我希望每行的第一个单元格都有一个严格用于切换的复选框。我可以显示复选框,但我无法让它让我选中它。

<table class="table table-hover">
  <thead>
    <th></th>
    <th>Things</th>
    <th>Stuff</th>
<th></th>
   </thead>
  <tbody>
  {{#each myArr as |item|}}
          {{#link-to 'application' tagName='tr' }}
      <td><input type="checkbox"></td>
      <td>{{item}}</td>
      <td> Something</td>
          {{/link-to}}
  {{/each}}
  </tbody>
</table>
  • 我不想去路线
  • 复选框需要切换
  • 该复选框不需要保存值(可以在页面刷新时销毁)
  • 使用 {{input}} 帮助程序没有区别

我有一个叽叽喳喳 https://ember-twiddle.com/bc53d499687ad8bdc902be5cd7d77f48

您需要作为组件分开。

请看这个叽叽喳喳