似乎handlebars-loader没有像我预期的那样处理内联部分。
我希望你以与{{> @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}}
作为内联部分处理,但会尝试加载文件但显然会失败。
有人可以建议吗?也许我想要太多......