if
如果特定条件为true则呈现表达式。
{{#if condition }}
expression
{{/if}}
参数
-
conditionexpression: 要判断的条件。
例子
对比两个值,前提是两个值类型是一致的。
{{#if product.price > 30 }}
product price more than 30
{{/if}}
elseif
{{#if product.price < 30 }}
product price less than 30
{{#else if product.price > 30 /}}
product price more than 30
{{/if}}
{{#if product.price < 30 }}
product price less than 30
{{#else/}}
product price more than 30
{{/if}}
这篇文章对你有帮助吗?
SHOPLINE