由于我的 Handlebars JS 模板,我遇到了一个令人沮丧的错误。
Error: Parse error on line 9:
... {{/each}} {{/if}}
----------------------^
Expecting 'EOF'
有问题的车把:
{{if showSingle}}
{{#with single}}
{{> postSingle}}
{{/with}}
{{else}}
{{#each posts}}
{{> postItem}}
{{/each}}
{{/if}}
这样的嵌套是不可能的吗?
只是为了把事情放在上下文中,这工作得很好:
{{#each posts}}
{{> postItem}}
{{/each}}