该字段不存在于表单模式中,我在表单中使用的是离子模板,此代码对我不起作用:
Template.example.helpers({
cardOptions: [
{ value: 0, label:'Visa' },
{ value: 1, label:'MasterCard' },
{ value: 2, label:'Elo' },
{ value: 3, label:'Hipercard' },
{ value: 4, label:'Hiper' }
]
});<template name="example">
{{> afQuickField name="payment.card" type="select-radio" options=cardOptions }}
</template>
发布于 2015-12-05 17:57:41
如果要单独定义字段,则需要使用autoForm组件。
例如:
<template name="example">
{{#autoForm collection="Payments" id="insertPaymentForm" type="insert"}}
<fieldset>
<legend>Add a Payment Method</legend>
{{> afQuickField name='title'}}
{{> afQuickField name="card" type="select-radio" options=cardOptions }}
</fieldset>
<button type="submit" class="btn btn-primary">Insert</button>
{{/autoForm}}
</template>这是一个MeteorPad。
https://stackoverflow.com/questions/34108238
复制相似问题