block

Used for rendering blocks within the current iteration scope. It must be used nested inside a blocks tag.

{{#blocks}}
{{#block [hash...] /}}
{{/blocks}}

hash

Pass parameters to the block in key-value pairs. Within the block, these parameters can be accessed via the props object.

Example

Special block processing

In the @/product-card block, the product parameter is passed and used.

<!-- section/product-list/product-list.html -->
{{#blocks}}
{{#if forblock.type == "@/product-card"}}
{{#block product=product /}}
{{#else /}}
{{#block /}}
{{/if}}
{{/blocks}}
<!-- blocks/product-card.html -->
<div>{{ props.product.title }}</div>
Was this article helpful to you?