【发布时间】:2015-07-03 06:35:39
【问题描述】:
我正在寻找如何通过 yield 语句访问当前模型。有什么想法吗?
型号
models: [{
id: 1,
name:'Red',
value: '#ff0000'
}, {
id: 2,
name:'Yellow',
value: '#ffff00'
}, {
id: 3,
name:'Blue',
value: '#0000ff'
}];
模板
{{#table-list models=models config=colorModelTableListConfig}}
{{model.id}}
{{model.name}}
{{model.value}}
{{/table-list}}
组件(表格列表)
<!-- Searching markup-->
<table>
{{#each th in config.tableHeaders}}
<th>{{th}}</th>
{{/each}}
{{#each model in models}}
{{yield}}
{{/each}}
</table>
<!-- Pagination markup-->
旁注我不能将 each 放入 yield,这会导致我的搜索、分页和其他功能出现问题
回答
【问题讨论】: