【发布时间】:2014-04-13 01:28:57
【问题描述】:
在处理淘汰赛时,我经常使用templates。因为我正在开发单页应用程序,所以我使用的模板数量越来越多。
我的主要 html 开始看起来像这样:
<!-- id's for knockout binding -->
<span id='...'>...</span>
<span id='...'>...</span>
....
<span id='...'>...</span>
<!-- templates -->
<script type="text/html" id="template_1">...</script>
<script type="text/html" id="template_2">...</script>
...
<script type="text/html" id="template_100">...</script>
尽管如此,一切都按预期工作,我被大量模板吓倒了,一开始就被加载。
那么在这个问题上是否有任何最佳实践,或者在淘汰赛方面有良好经验的人如何处理它?
【问题讨论】:
标签: knockout.js knockout-templating knockout-3.0