I have a mustache template as follows
(我有一个小胡子模板,如下)
<script id="template" type="x-tmpl-mustache">
<div class="row">
{{#sums}}
<button {{sum}} type ="button" class="btn-primary">{{value}}
{{/sums}}
</div>
</script>
I want to capture the click events on each button of the template , this how I rendered the template:
(我想捕获模板每个按钮上的click事件,这就是我渲染模板的方式:)
Mustache.parse(template);
let tempData = [];
tempData.push({
sum,value
});
let rendered = Mustache.render(template, tempdata);
$('#block').append(rendered);
ask by Sabrina translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…