0

dotliquid 支持基本运算符,如和/或。

Basic operators

Operator    Function
==  equals
!=  does not equal
>   greater than
<   less than
>=  greater than or equal to
<=  less than or equal to
or  condition A or condition B
and condition A and condition B

是否支持“不”作为运算符?

4

1 回答 1

1

它包含unless作为控制流,在这里看到:

https://shopify.github.io/liquid/tags/control-flow/

意思是:

if a && b && !c
  # ...
end

翻译成:

{% if a and b %}
  {% unless c %}
    ...
  {% endunless %}
{% endif %}
于 2016-08-03T09:40:43.070 回答