【发布时间】:2015-09-13 01:41:45
【问题描述】:
我想在 if 语句中使用 and 条件
{{#if requiredExp equals 0 and tile equals "SSE"}}
Expierince cannot be equal to 0
{{/if}}
如何在meteor模板中使用and来写这个条件?
【问题讨论】:
-
请注意,您可以使用模板条件的嵌套以及反转逻辑。您的第一个条件可以表示为
{{#unless requiredExp}},只要requiredExp的所有其他可能值都是true。 但是,第二个条件中的字符串比较需要一个帮助器。 -
我回答了同样的问题here。
标签: meteor