如何使用JSONT制作if语句 [英] How to make an if statement with JSONT

查看:53
本文介绍了如何使用JSONT制作if语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检查属性的特定值?



IE:



<$的JSONT版本p $ p> if(someProperty == someValue){
//做一些事情
}


解决方案

if的流控制语法是:

  {。if分页} 
//做一些事情
{.end}

但是,如果您要查找if / equal,则:

  {。equal? @index 1} 
//做一些事情
{.end}

就是说,JSONT似乎是一种分叉的语言,没有活跃的社区从事任何特定的实现,因此语法会有所不同。在这种情况下,我指的是Squarespace的实现。


How can I check a property for a specific value??

IE: The JSONT version of

if(someProperty == someValue){
      //Do some stuff
}

解决方案

The control-of-flow syntax for if is:

{.if pagination}
// Do some stuff
{.end}

But if you're looking to do if/equals then:

{.equal? @index 1}
// Do some stuff
{.end}

That said, it appears that JSONT is a forked language without an active community working on any particular implementation so the syntax will vary. In this case, I'm referring to Squarespace's implementation.

这篇关于如何使用JSONT制作if语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆