【问题标题】:Meteor 1.2 : A way to access {{../@index}}Meteor 1.2:访问 {{../@index}} 的方法
【发布时间】:2016-01-23 02:44:27
【问题描述】:

我使用流星 1.2

这是我的代码:

{{#each steps}}
{{#each buttons}}
<button class="car-action-button" data-step-index="{{../@index}}" data-button-index="{{@index}}" data="{{../idOnMap}}" data-cid="{{../../cid}}">
</button>
{{/each}}
{{/each}}

{{../@index}} 应该返回步数排名,但不返回任何内容。有没有办法做到这一点?

【问题讨论】:

标签: javascript meteor meteor-blaze


【解决方案1】:

好的,这是我的解决方案:

{{#each steps}}
{{#let index = @index}}
{{#each buttons}}
<button class="car-action-button" data-step-index="{{index}}" data-button-index="{{@index}}" data="{{../idOnMap}}" data-cid="{{../../cid}}">
</button>
{{/each}}
{{/let}}
{{/each}}

希望对某人有所帮助:)

【讨论】:

    猜你喜欢
    • 2016-04-17
    • 2015-11-28
    • 1970-01-01
    • 1970-01-01
    • 2015-11-22
    • 2015-02-02
    • 2016-03-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多