这是我的模板:
<!-- TEMPLATE -->
<div id="templateDiv" data-win-control="WinJS.Binding.Template">
<div class="tile" data-win-bind="textContent: QuestionText"></div>
</div>
我的输出是这样的:
<div id="itemsControl" data-win-control="Samples.ItemsControl">
<div class="win-template">
<div class="tile" data-win-bind="textContent: QuestionText">Sample Data 1</div>
</div>
<div class="win-template">
<div class="tile" data-win-bind="textContent: QuestionText">Sample Data 2</div>
</div>
<div class="win-template">
<div class="tile" data-win-bind="textContent: QuestionText">Sample Data 3</div>
</div>
<div class="win-template">
<div class="tile" data-win-bind="textContent: QuestionText">Sample Data 4</div>
</div>
</div>
我想覆盖 class=" win-template " 或添加到输出中的 class 属性。我试图将 class="sample-class" 放在 templateDiv 中,但没有运气。它似乎覆盖了我尝试的一切。