【问题标题】:meteoric autoform select-radio does not work流星自动选择收音机不起作用
【发布时间】:2016-03-10 13:27:02
【问题描述】:

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

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>

【问题讨论】:

    标签: meteor ionic meteor-autoform meteoric


    【解决方案1】:

    如果要单独定义字段,则需要使用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

    【讨论】:

      猜你喜欢
      • 2023-02-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-29
      • 2017-12-25
      • 1970-01-01
      相关资源
      最近更新 更多