【发布时间】:2015-09-12 08:48:33
【问题描述】:
我想做一些与这个问题非常相似的事情:Meteor: Custom AutoForm with array of objects
也就是说,我想在数组的每个元素中手动布局每个字段。
不同的是,我仍然想使用afArrayField 及其默认模板,包括添加和删除数组项的按钮。我只想将自己的布局传递给afArrayField。我该怎么做?
如果我没有说清楚,请要求澄清,我会改写。
【问题讨论】:
我想做一些与这个问题非常相似的事情:Meteor: Custom AutoForm with array of objects
也就是说,我想在数组的每个元素中手动布局每个字段。
不同的是,我仍然想使用afArrayField 及其默认模板,包括添加和删除数组项的按钮。我只想将自己的布局传递给afArrayField。我该怎么做?
如果我没有说清楚,请要求澄清,我会改写。
【问题讨论】:
您可能需要创建一个自定义模板(文档:https://github.com/aldeed/meteor-autoform#creating-a-custom-template)。
你可以做类似的事情(未经测试):
<template name="your_template">
{{# autoForm [...]}}
[...]
{{> afQuickField name="players" template="custom_players"}}
[...]
{{/autoForm}}
</template>
<template name="afArrayField_custom_players">
your custom template for players field
</template>
您还可以查看默认的 afArrayField 模板来激发自己的灵感:
【讨论】: