0
我不確定如何在mustache/handlebars部分參數映射內引用@index(來自#each helper)。例如。在部分參數中使用@index
{{#each this.things}}
<p>Thing {{@index}}</p>
{{> mypartial id='thing{@index}' }}
{{/each}}
產量:
<p>Thing 0</p> <!-- correct -->
<div id="thing{@index}">/div> <!-- incorrect -->
一個選項是改變我的部分,以在其內引用@index,但我想繼續使用該ID的部分參數。