0

该字段在表单架构中不存在,我在表单中使用离子模板,此代码对我不起作用:

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>

4

1 回答 1

0

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

于 2015-12-05T17:57:41.907 回答