Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
了解该if声明已被弃用,我将如何在尘土中实现以下内容?
if
我有一个带有以下伪代码的模板:
<div class="cities">{#city.name}Welcome to {if ..length > 10} <br> {.} {/city.name}</div>
如果有问题的字段长度超过 10 个字符,则插入<br>换行符。例如,有没有办法使用运算符来完成此操作?citynameselect
<br>
city
name
select
Dust 有一个gt过滤器,可以满足您的需求。就像是:
gt
<div class="cities"> {#city} {@gt key=name.length value="10" type="number"}<br/>{/gt} {name} {/city} </div>