1

似乎车把加载器没有像我预期的那样处理内联部分。我希望您以与{{> @partial-block}}. 假设我们有 index.hbs

{{#>wrapper}}
    {{#*inline "column1"}}
        This is test for col 1
    {{/inline}}
    {{#*inline "column2"}}
        This is test for col 2
    {{/inline}}
{{/wrapper}}
{{#>wrapper}}
    {{#*inline "column1"}}
        This is another test for col 1
    {{/inline}}
    {{#*inline "column2"}}
        This is another test for col 2
    {{/inline}}
{{/wrapper}}

和 wrapper.hbs 部分

<div class="wrapper">
    <div class="column1">
        {{> column1}}
    </div>
    <div class="column2">
        {{> column2}}
    </div>
</div>

我预计

<div class="wrapper">
    <div class="column1">
        <div class="one">
            This is test for col 1
        </div>
    </div>
    <div class="column2">
            This is test for col 2
    </div>
</div>
<div class="wrapper">
    <div class="column1">
            This is another test for col 1
    </div>
    <div class="column2">
            This is another test for col 2
    </div>
</div>

但不幸的是,加载器不处理{{> column1}}内联部分,而是尝试加载文件并且显然失败。有人可以建议吗?可能是我想要的太多了……

4

0 回答 0