标签: html handlebars.js templating
例如,<div class="hi_" + "1"> (这不起作用)
<div class="hi_" + "1">
使用案例是我在手把中进行模板操作而我的代码是:
{{#each this}} <div class="box_" + {{id}}> {{/each}}
我如何命名我的div?
答案 0 :(得分:1)
您可以简单地将占位符插入到类属性中,如下所示:
{{#each this}} <div class="box_{{ id }}"></div> {{/each}}