0
工作嵌套屬性我有2個對象results
和_.keys(result[0])
Ractivejs:如何獲得鑑於
r{
data:{
headers:['head1','head2']
result:[
{head1:'content1',head2:'content2'}
{head1:'content3',head2:'content4'}
{head1:'content5',head2:'content6'}
]
}
產生headers
headers
我對dinamically創建一個表,所以我創建這個:
<table class="ui celled table segment">
<thead>
<tr>
{{#headers}}
<th>{{.}}</th>
{{/headers}}
</tr></thead>
<tbody>
{{#result:i}}
<tr>
{{#headers:h}}
<td>{{????}}</td> <-- Here is where I fail to know what to put into
{{/headers}}
</tr>
{{/result}}
</tbody>
</table>
有人可以幫我填補空白。所以,我可以創建一個表,顯示contents
如果我刪除{{#headers}}
一部分,我已經知道的元素<td>{{.head1}}</td>
工作完美,問題是我'產生的飛行不同的對象。