【发布时间】:2016-09-26 08:59:20
【问题描述】:
我有一个 JSON 被传递给 Dust 模板,并且想要比较多个键的相同值。例如我有一个像这样的 JSON:
"data": {
"abc": "true",
"xyz": "true",
"uno": "true"
}
除了使用“IF”条件(已弃用)之外,还有其他方法可以一次比较所有条件吗?
我不想做
{?data.abc}
{?data.xyz}
{?data.uno}
<DO something when all of them are true>
{/data.uno}
{/data.xyz}
{/data.abc}
有没有更好的方法来处理上述情况?
附: dust-helper 版本 1.5.0 或更低版本。
【问题讨论】:
标签: json template-engine dust.js dust-helpers