【发布时间】:2016-02-04 01:33:47
【问题描述】:
我想要一个两列布局来显示返回的集合信息。现在我有一个两列布局,如:
<template name="Participants">
<div class="container">
<h4 style="text-align: center">{{ReportsMonth}} {{ReportsCamp}} {{ReportsYear}} {{ReportsTitle}}</h4>
{{#each programReports}}
<div class="row">
<div class="col s6">
<h5>Name: {{FullName}}</h5>
<p>Age: {{calculateAge Bdate}}<br> Sex: {{Sex}}<br> Level: {{Level}}<br> Location: {{City}}, {{State}}</p>
</div>
<div class="col s6">
<h5>Name: {{FullName}}</h5>
<p>Age: {{calculateAge Bdate}}<br> Sex: {{Sex}}<br> Level: {{Level}}<br> Location: {{City}}, {{State}}</p>
</div>
</div>
{{/each}}
</div>
</template>
问题当然是当它迭代时,它会将文档重复到下一列;它只有在完成行时才会到达下一个文档。有没有办法让它迭代以用下一个文档填充每一行中的每个 div?
例子:
当前的 HTML 输出:
a a
b b
期望:
a c
b d
或者:
a b
c d
【问题讨论】:
-
为什么不简单地有一个
row,让网格系统做列流(每次迭代发出一个col s6)? -
您说得对,先生。谢谢。
标签: meteor meteor-blaze