就像是:
<div>
<%- if (condition) { %>
<div>This text will be shown if `condition` is true</div>
<%- } %>
</div>
Run Code Online (Sandbox Code Playgroud)
上面的例子没有用,所以我问是否有任何方法在模板字符串中使用IF条件,我知道Underscore支持开箱即用.
| 归档时间: |
|
| 查看次数: |
964 次 |
| 最近记录: |