在Spry地区加倍条件

时间:2022-08-24 16:20:10
<div spry:region="ds1" spry:repeatchildren="ds1">
  <b spry:if=" '{title}'!='' ">
    <!-- this is the first if --> 
    <a href="#"  spry:if=" '{author}'!='' ">{author}
      <!-- this is the second if -->
    </a>
  </b>
</div>



I wonder if there is any method as simple as

我想知道是否有任何方法如此简单

if(x==y && i>j)  

in

<b>spry</b> 

region. I can't find any information in spry docs (labs.adobe.com/technologies/spry/)

区域。我在spry docs中找不到任何信息(labs.adobe.com/technologies/spry/)

3 个解决方案

#1


1  

The syntax inside the spry:if attribute is Javascript, so you can use &&:

spry里面的语法:if属性是Javascript,所以你可以使用&&:

<b spry:if="'{title}' != '' && '{author}' != ''">
<!-- ... -->
</b>

#2


1  

also you can call a function instead

你也可以调用一个函数

spry:if="myFunc();"

and in your function return Boolean value as result

并在您的函数中返回布尔值作为结果

function myfunc()
{
//do somethings ;
if(...)
return true;
else
return false;
}

#3


0  

Normally I do like this

通常我喜欢这个

<div spry:region="ds1" spry:repeatchildren="ds1">
    <b spry:if=" '{ds1::title}'!='' && '{ds1::author}'!=''">
        <a href="#">{author}</a>
    </b>
</div>

#1


1  

The syntax inside the spry:if attribute is Javascript, so you can use &&:

spry里面的语法:if属性是Javascript,所以你可以使用&&:

<b spry:if="'{title}' != '' && '{author}' != ''">
<!-- ... -->
</b>

#2


1  

also you can call a function instead

你也可以调用一个函数

spry:if="myFunc();"

and in your function return Boolean value as result

并在您的函数中返回布尔值作为结果

function myfunc()
{
//do somethings ;
if(...)
return true;
else
return false;
}

#3


0  

Normally I do like this

通常我喜欢这个

<div spry:region="ds1" spry:repeatchildren="ds1">
    <b spry:if=" '{ds1::title}'!='' && '{ds1::author}'!=''">
        <a href="#">{author}</a>
    </b>
</div>