0

复合条件语句不起作用。我的代码有什么问题?

{{if (parseInt(address) >= 6001 && parseInt(address) <= 31999) ||
     (parseInt(address) >= 35004 && parseInt(address) <= 38589) }}
          <span>这里有一些文字....</span>
          <span>这里有一些文字...</span>
{{/如果}}

{{if (parseInt(address) >= 6001 && parseInt(address) <= 31999) ||
    (parseInt(address) >= 35004 && parseInt(address) <= 38589) }}
    <span>Some text here...</span>;
    <span>Another some text here...</span>;
{{/if}}  
4

1 回答 1

0

我不知道这是什么语言,但你可能在一开始就缺少括号:

编辑:

{{if((parseInt(address) >= 6001 && parseInt(address) <= 31999) || 
     (parseInt(address) >= 35004 && parseInt(address) <= 38589)) }}
          <span>Some text here....</span> 
          <span>Another some text here...</span> 
{{/if}}

这是此代码的缩进版本,以便您可以查看需要 perens 的位置(请注意此格式可能与您的语言不兼容):

{{
    if( 
            (parseInt(address) >= 6001 && parseInt(address) <= 31999 )
                || 
            (parseInt(address) >= 35004 && parseInt(address) <= 38589)
        )
}} 
          <span>Some text here....</span> 
          <span>Another some text here...</span> 
{{
    /if
}}

两侧的 2 个条件||未正确封闭。

于 2013-09-28T12:48:19.503 回答