【发布时间】:2017-01-24 16:16:23
【问题描述】:
我有一个 collection,其中包含一个 tab 模型数组
喜欢
[
new TabModel({ title: 'Step 1', template: 'step1.html' }),
new TabModel({ title: 'Step 2', template: 'step2.html' }),
new TabModel({ title: 'Step 3', template: 'step3.html' }),
new TabModel({ title: 'Step 4', template: 'step4.html' })
]
在我的View 循环collection 中,我得到了标题和template,它位于templates 文件夹下。
在View中获取模板内容的方法是什么
【问题讨论】:
-
获取模板的内容与 Backbone 无关。只是加载一个文件的内容,解决方法很多。