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(status==1){ %> <%= status %> <% } %>
有没有办法删除重叠的 %> 和 <%= ?
我是一名 php 开发人员,上面的 php 代码将是:
<?php if($status==1){ echo $status; } ?>
有没有办法像“回声”一样在下划线中回显?
是的,试试print();
print();
喜欢:
<% if(status===1) { print(status); } %>
文档:http ://underscorejs.org/#template