我已经嵌套了每个,并希望使用父this
值。
{{#each county}}
Country name : {{this}}
{{#each state}}
{{this}} is one of the state of {{country}} //here how to use country
{{/each}}
{{/each}}
我已经尝试了{{../this}}
,但它显示了
Can only use `this` at the beginning of a path.
Instead of `foo.this` or `../this`, just write `foo` or `..`.
答案 0 :(得分:1)
只需你可以做
{{#each county}}
Country name : {{this}}
{{#each state}}
{{this}} is one of the state of {{..}} //here how to use country
{{/each}}
{{/each}}
请参阅{{..}}
编辑:已编辑的答案